How to extract first position of record 2 and add to record1
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
How to extract first position of record 2 and add to record1
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
- 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
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
Yes, we have purchased TextPipe - ArvinMeritor
- 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
No worries, use an EasyPattern match
Replace with
Remember to use the Replace first only option
ie.
Code: Select all
[ capture( 0+ not cr or lf) as 'line' ]
[ capture( 1 char ) as 'first' ]
Code: Select all
@first@@line
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
Can EasyPatterms be created from within TextPipe or do I have to download it?
- 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
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.