Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fast CSV columns sorting

Status
Not open for further replies.

Melko

Civil/Environmental
Mar 25, 2002
53
I'd like to know if exist a simple program that can sort columns of a .csv (actually semicolon separated value) without need to make it manually.

I need this because the program that make me the report use the columns in a wrong order and everyday I have to sort them manually in excel. It is quite boring and shouldn't hard to automatize.

Thanks
 
Replies continue below

Recommended for you

Open it in Excel and sort, then save
 
for what you requested, i do not know of a standard technique to sort columns.

although i've not accomplished this technique, try this...

1) copy the data and USING the paste special command, select values and the TRANSPOSE option. select OK. this action transposes the data (i.e. row data are now column data and vice versa).

2) then use the standard excel sort criteria to sort data to your desire.

3) repeat step 1) and check. you might need to experiment a couple of times to obtain the desired sort.

Good luck!
-pmover
 
You could try recording a macro in excel that would open the file, move everything around, save, and close. The only problem is if your file name changes (as it sounds like it might be a daily incrementing file), you will need to have a dialog box pop up and ask you for the file name unless you can have the macro run in the middle of opening the file (I assume with the deliminated file excel asks where all the columns ned to be set and you don't want to have to keep repeating this).
 
You do have the option to sort by columns as opposed to sorting by rows, at least in Excel2000, anyway. If you open the options on the sort dialog, you can select sort left to right, which then transposes the sort criteria TTFN
 
ivanlocke ideas seems good.
Also pmover's one seems good... I'll try them both....
 
Why do you want to transpose, sort and re-transpose when you can directly sort the columns? TTFN
 
Thanks everyone, as lots said, there is no need of traspose. But the idea of make a list of number and sort using them is quite good and worked perfecly.

I'll try to make a macro that add a new row write in it the numbers, sorts colunms and delete the row.

Eng tips ROCKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor