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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

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

Postby gkata99 » Mon Jul 20, 2009 10:51 pm

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: 2138
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

Postby DataMystic Support » Tue Jul 21, 2009 10:01 am

Easy. Have you purchased TextPipe - we can send this sample filter directly to you.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

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

Postby gkata99 » Fri Jul 24, 2009 9:21 pm

Yes, we have purchased TextPipe - ArvinMeritor

User avatar
DataMystic Support
Site Admin
Posts: 2138
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

Postby DataMystic Support » Mon Jul 27, 2009 9:15 am

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
 
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

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

Postby gkata99 » Fri Aug 14, 2009 3:37 am

Can EasyPatterms be created from within TextPipe or do I have to download it?

User avatar
DataMystic Support
Site Admin
Posts: 2138
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

Postby DataMystic Support » Fri Aug 14, 2009 8:25 am

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.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 2 guests