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.

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

share|improve this question

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

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

    
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

1 Answer 1

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
share|improve this answer

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.