Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I thought I remember reading that there is a text editor that exists for windows that allows the sorting of data, treating the csv/tsv similar to how it is treating when one sorts in excel.

Any pointer is appreciated it is driving me crazy.

thanks

share|improve this question
1  
A downgrade without a comment is pointless. If you are going to do this, please at least let me know how to improve. –  jason m Jan 24 '13 at 3:11
    
I don't know why the downvote. Maybe because you are asking for a software recommendation which is inappropriate. But since you combined your question with a specific problem (sorting of CSV without Excel), I think its a valid question. –  nixda Jan 24 '13 at 12:14
add comment

2 Answers 2

up vote 2 down vote accepted

Does it has to be a text editor? Or is a (portable) CSV/TSV editor also acceptable?

CSVed is an easy and powerful CSV file editor, you can manipulate any CSV file, separated with any separator.

Here is a screenshot of its sort functions

enter image description here

share|improve this answer
    
Ah absolutely perfect. Works like a charm, and quickly on some decent sized files! –  jason m Jan 26 '13 at 17:03
add comment

I can't think of a Windows editor that does this internally but Vim or Emacs can do it via some external tools, if that might be useful to you? Dealing with a proper CSV file would be a bit complicated but, for the simple case of a file like this example:

1,z,3
2,y,4
3,x,5

... a Vim command to sort the file by the second field in each line would be:

:%!cut -f2,1,3 -d, | sort | cut -f2,1,3 -d,

This relies on having cut available (e.g. from the GNU textutils, which are available for Windows) and the usual Windows sort, because the command will pipe the text through those external programs to do the work.

For a proper CSV file, though, it would be necessary to parse the CSV fully to deal with quoted commas before sorting by this method, and then to put the fields back into order again.

An example of piping through sort from Vim can be found on StackOverflow here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.