Formatting output of .csv file

Get help with installation and running here.

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

Post Reply
stolireef
Posts: 2
Joined: Fri Jun 25, 2010 5:03 am

Formatting output of .csv file

Post by stolireef »

I have a large .csv file that I need to output to a very specifically formatted text file.
eg.
Column 1 (20 characters) Column 2 (11 Characters SSN) Column 3 (12 Characters Telephone)

Even if the text in the given string is either non-existant or shorter/longer than the number of characters specified, the string must either be shortened or lengthened to ensure that the columns are precisely as required.

I have no difficulty extracting the data and removing the comas however, from there,I can't seem to figure out how to format the output text file as noted above. Any help would be greatly appreciated.

BTW: I'm a big booster of Textpipe. It's allowed me to do some amazing things on large data sets. Thanks.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Formatting output of .csv file

Post by DataMystic Support »

You need to adjust the spacing before removing the commas, using the Add\Force to Width filter.

e.g. for field 1, use

Restrict fields:1 Comma-delimited fields starting at field 1
+--Force to width 20

then do the same for fields 2-3, before finally removing commas.
stolireef
Posts: 2
Joined: Fri Jun 25, 2010 5:03 am

Re: Formatting output of .csv file

Post by stolireef »

I was almost there and you gave me the last piece of the puzzle. Once again, nothing but good things to say about you and your program.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Formatting output of .csv file

Post by DataMystic Support »

Thank you! Please tell your colleagues and friends about TextPipe!
Post Reply