Page 1 of 1

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

Posted: Mon Jul 20, 2009 10:51 pm
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

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

Posted: Tue Jul 21, 2009 10:01 am
by DataMystic Support
Easy. Have you purchased TextPipe - we can send this sample filter directly to you.

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

Posted: Fri Jul 24, 2009 9:21 pm
by gkata99
Yes, we have purchased TextPipe - ArvinMeritor

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

Posted: Mon Jul 27, 2009 9:15 am
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
 

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

Posted: Fri Aug 14, 2009 3:37 am
by gkata99
Can EasyPatterms be created from within TextPipe or do I have to download it?

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

Posted: Fri Aug 14, 2009 8:25 am
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.