Page 1 of 1

Format of Output File...

Posted: Sun Apr 14, 2013 2:36 am
by mr991
Hi:

I am processing a text file on which each line has to be processed individually. I need to be able to control the format of the output file (i.e. I want to control when to output

Input File:

Name: aaaa.bbbb
Address: 216 N Avenue
Address2: LA, CA

I want the output file to be like this:

aaaa.bbbb<tab>216 N Avenue<tab>LA,CA

I have not been able to find a control that allows me to do the above. It is import to delete some columns from multiple lines in the input file and output them to SAME LINE on the output file. So far, I've used the remove field<tab delimited> and I'm able to delete the columns I want.

However, textpipe processes a line, removes the fields i want and then outputs what I want on the same lines and moves to the next line. Essentially, textpipe processes the first line and then outputs the first line. Then it processes the 2nd line from the input and moves on to the 2nd line on the output.

I want textpipe to process multiple lines from the input and output certain columns in the output line and move on to the next line on the output when I want it to.

Any help to achieve the above would be appreciated.

Martin

Re: Format of Output File...

Posted: Fri Apr 19, 2013 1:15 pm
by DataMystic Support
Hi Martin,

Just use an EasyPattern search/replace:

Code: Select all

Name: [ capture(1+chars) as 'name' ]
Address: [ capture(1+chars) as 'addr1' ]
Address2: [ capture(1+chars) as 'city' ], [ capture(1+chars) as 'state' ]
Replace with:

Code: Select all

@name@\t@addr1@\t@city@\t@state@