| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Tue Apr 19, 2005 3:55 pm Post subject: Sorting items in a text file |
|
|
I want to sort the elements in a text file (each element is in its own line)
it looks like this in the text file
"
dfsdf
rrgrg
asdff
wefef
(..etc)
"
What is the best way to sort then output the results into another text file? |
|
| Back to top |
|
 |
BoBo Guest
|
|
| Back to top |
|
 |
niwi
Joined: 27 Feb 2005 Posts: 128 Location: Heidelberg, Germany
|
Posted: Tue Apr 19, 2005 5:57 pm Post subject: |
|
|
Hi,
Run, sort.exe infile.txt /o outfile.txt
NiWi. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Tue Apr 19, 2005 7:56 pm Post subject: |
|
|
| Code: |
F2=TEST.TXT
FileRead, S, %F2%
FileDelete, %F2%
Sort, S
FileAppend, %S%, %F2%
exitapp
|
|
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Tue Apr 19, 2005 8:03 pm Post subject: |
|
|
sorry guest, here the existing and the sorted text file
| Code: |
F1=ORIG.TXT
F2=SORTED.TXT
FileRead, S, %F1%
FileDelete, %F2%
Sort, S
FileAppend, %S%, %F2%
exitapp
|
|
|
| Back to top |
|
 |
|