| in memo currPos line out |
in := FileStream oldFileNamed: 'in.txt'.
memo := Dictionary new.
[ currPos := in position.
(line := in nextLine) notNil
] whileTrue: [memo at: line hash put: currPos].
in reset.
out := FileStream forceNewFileNamed: 'out.txt'.
memo values sort do: [:pos |
out nextPutAll: (in position: pos; nextLine); cr].
in close. out edit
sumim
#3472()
[
Smalltalk
]
Rating0/0=0.00
| in memo currPos line out | in := FileStream oldFileNamed: 'in.txt'. memo := Dictionary new. [ currPos := in position. (line := in nextLine) notNil ] whileTrue: [memo at: line hash put: currPos]. in reset. out := FileStream forceNewFileNamed: 'out.txt'. memo values sort do: [:pos | out nextPutAll: (in position: pos; nextLine); cr]. in close. out editRating0/0=0.00-0+
1 reply [ reply ]