Formatting output of .csv file

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Formatting output of .csv file

Postby stolireef » Fri Jun 25, 2010 5:15 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Formatting output of .csv file

Postby DataMystic Support » Fri Jun 25, 2010 6:44 am

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

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

Re: Formatting output of .csv file

Postby stolireef » Fri Jun 25, 2010 7:16 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Formatting output of .csv file

Postby DataMystic Support » Fri Jun 25, 2010 8:54 am

Thank you! Please tell your colleagues and friends about TextPipe!
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 6 guests