×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Fast CSV columns sorting

Fast CSV columns sorting

Fast CSV columns sorting

(OP)
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

RE: Fast CSV columns sorting

Open it in Excel and sort, then save

RE: Fast CSV columns sorting

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

RE: Fast CSV columns sorting

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

RE: Fast CSV columns sorting

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

RE: Fast CSV columns sorting

(OP)
ivanlocke ideas seems good.
Also pmover's one seems good... I'll try them both....

RE: Fast CSV columns sorting

Why do you want to transpose, sort and re-transpose when you can directly sort the columns?

TTFN

RE: Fast CSV columns sorting

(OP)
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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources