Is there any functionality by which I can sort the contents of a file in place in windows 7 ?

I am not sure if there is any way I could do it in UI, but is there any batch script which will help me do it ?

An example of what I am trying to do.

Let file "data.txt" containing the follwing data be the input file

A12
A04
B08
B01

The output data.txt should contain

A04
A12
B01
B08

Basically, something like a natural sort.

How can I achieve this in windows 7

link|improve this question
What do you mean by sort a file? Sort the contents? By what order? Or do you mean to sort the file list? How do you want to do it, programatically, or through the Windows UI? – Ray Sep 5 '11 at 13:28
Made the question more clear. – vinoth Sep 5 '11 at 13:35
@cmv: You actually didn't make it any more clear. Ray's questions still stand. What exactly are you trying to do? What kind of file are you talking about? Sort it how? – David Sep 5 '11 at 13:37
I edited the question once more. – vinoth Sep 5 '11 at 13:41
feedback

migrated from stackoverflow.com Sep 5 '11 at 22:30

This question came from our site for professional and enthusiast programmers.

1 Answer

windows 7 and much older versions of windows have an exe: sort.exe it makes exactly what you want (as I understud your question) use it as:

sort <data.txt >newData.txt
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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