How to extract first position of record 2 and add to record1

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
gkata99
Posts: 12
Joined: Sat Jul 18, 2009 12:36 am

How to extract first position of record 2 and add to record1

Post by gkata99 »

I have a file that I need to extract the first character from line 2 and add this character to the very first position in line 1
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: How to extract first position of record 2 and add to record1

Post by DataMystic Support »

Easy. Have you purchased TextPipe - we can send this sample filter directly to you.
gkata99
Posts: 12
Joined: Sat Jul 18, 2009 12:36 am

Re: How to extract first position of record 2 and add to record1

Post by gkata99 »

Yes, we have purchased TextPipe - ArvinMeritor
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: How to extract first position of record 2 and add to record1

Post by DataMystic Support »

No worries, use an EasyPattern match

Code: Select all

[ capture( 0+ not cr or lf) as 'line' ]
[ capture( 1 char ) as 'first' ]
Replace with

Code: Select all

@first@@line
Remember to use the Replace first only option

ie.

Code: Select all

EasyPattern [[ capture( 0+ not cr or lf) as 'line' ]\r\n[ capture( 1 char ) as 'first' ]] with [@first@@line]
   [ ] Match case
   [ ] Whole words only
   [ ] Case sensitive replace
   [X] Prompt on replace
   [ ] Skip prompt if identical
   [X] First only
   [ ] Extract matches
   Maximum text buffer size 4096
 
gkata99
Posts: 12
Joined: Sat Jul 18, 2009 12:36 am

Re: How to extract first position of record 2 and add to record1

Post by gkata99 »

Can EasyPatterms be created from within TextPipe or do I have to download it?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: How to extract first position of record 2 and add to record1

Post by DataMystic Support »

EasyPatterns are included in TextPipe - they are an additional search type like perl regex pattern - you'll find them in the search type drop down list.
Post Reply