How To Align data by coma?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
joram7
Posts: 2
Joined: Thu May 12, 2005 1:10 am

How To Align data by coma?

Post by joram7 »

Hope someone had an idea,
lets say i had a data

aaaa,***123,***bbbb,****, *******,cccccc,**ddd,**192939,****,23414,

jsdfh,4355, sgsg,s,sgsg,ssgsg, fdf, 234325, , 32235,
jsdfh,4355, sdsg,s,sgsg,sggsg, fdf, 23432df5, , 32235,
jsdfh,4355, ssg,s,sgsg,sggsg, fwerdf, 234325, , 3235,
jsdfh,4355, ssg,s, ,gsg, fdf, 234325, , 32235,
jsdfh,4355, ssg,s,sgsg,sggsg, fdf, 234325, , 3235,
jsdfh,4355, g,s,sgsg,ssgsg, fdf, 2325, , 32235,
jsdfh,4355, sdsg,s,sgsg,sggsg, fdf, 234325, , 32235,
jsdfh,4355, sg,s,sgsg,sgssg, fdf, 23425, , 3235,

and i need to align all the data according to the data in line one.it must match the coma lines
* is just the empty spacing
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Just one form the hip here as I'm not sure about control characters in prn files, but here goes:
Paste it into Excel (or even OpenOffice?) and then Text-To-Column it. Save it as a prn file (Formatted Text (Space Delimited)). Open the prn file in TP, save it as a txt file and you should then be able to operate on the file in Block Select Mode to your hearts content using the Edit->Fill Block command and delete button. Oh and when in Block Select Mode, first select your range in the first line and then press Ctrl-Shift-End, saves a whole lot of scrolling when working with large files. Hope it helps!
Then I open up and see
the person fumbling here is me
a different way to be
joram7
Posts: 2
Joined: Thu May 12, 2005 1:10 am

Post by joram7 »

hmm, i still dont get it, this data was actually from excel where i converted it into csv files, then view it with TP, i need to arrange this data according to the coma as shown in my first line sample. I need the coma and the data in lines and in the right spacing so that later the program which i will import to will recognize and able to read them.
do you think you can help me if i sent u a sample?
User avatar
Jan Paul
Posts: 21
Joined: Mon Apr 28, 2003 1:24 pm
Location: The Netherlands

Post by Jan Paul »

If you are working with CSV files, you should look into CSVeD, a very good (cardware) CSV editor.
See http://home.hccnet.nl/s.j.francke/software/software.htm.
User avatar
tcebob
Posts: 80
Joined: Fri Mar 28, 2003 1:20 am

Post by tcebob »

Here's an outline suggestion:

1. Set up a new Document Class for this need

2. Be sure the screen and print font is monospaced. (I find that Monospac821BT works really well.)

3. Set tab spacing according to your needs.

4. Make a macro to replace all comma-followed-by-any-number-of-spaces with comma-tab.

That should do it.

tcebob
Post Reply