Page 1 of 1

Alphabetically sort file

Posted: 24 May 2013 22:37
by keyboard1333
Hey all :)
I have a simple script that writes text to a file.
What I'd like to add, is the ability to sort each line of the file alphabetically.

So say I have

Code: Select all

alpha
charlie
bravo


the script would re-order it to

Code: Select all

alpha
bravo
charlie


Thanks!
keebs

Re: Alphabetically sort file

Posted: 24 May 2013 22:48
by foxidrive

Code: Select all

sort <"filein.txt" >"fileout.txt"


Type sort /?
to see the switches.

Re: Alphabetically sort file

Posted: 25 May 2013 18:23
by keyboard1333
Wow, so simple :p
Thanks heaps :)