AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting items in a text file

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue Apr 19, 2005 3:55 pm    Post subject: Sorting items in a text file Reply with quote

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





PostPosted: Tue Apr 19, 2005 4:08 pm    Post subject: Reply with quote

[FileRead]
[Loop]
[Sort]
Cool
Back to top
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Tue Apr 19, 2005 5:57 pm    Post subject: Reply with quote

Hi,

Run, sort.exe infile.txt /o outfile.txt

Wink

NiWi.
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1186
Location: switzerland

PostPosted: Tue Apr 19, 2005 7:56 pm    Post subject: Reply with quote

Code:

F2=TEST.TXT
FileRead, S, %F2%
FileDelete, %F2%
Sort, S
FileAppend, %S%, %F2%
exitapp

Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1186
Location: switzerland

PostPosted: Tue Apr 19, 2005 8:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group