Skip to content

Instantly share code, notes, and snippets.

@Oxyd76
Created December 4, 2016 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oxyd76/f46b6d4accc0166d70127e3ed49a66d3 to your computer and use it in GitHub Desktop.
Save Oxyd76/f46b6d4accc0166d70127e3ed49a66d3 to your computer and use it in GitHub Desktop.
Sort numbers in every string of test.txt
/* REXX (OS/2) */
Parse arg filename
call stream filename, 'C', 'Open'
Do while Lines(filename)
line = linein(filename)
Parse value line with left ' ' right
If left > right Then line = right || ' ' || left
pos=stream(filename, 'C', 'Seek -'Length(line)+2)
call lineout filename, line
End
call stream filename, 'C', 'Close'
Exit
11 34
8 66
1 9
4 10
1 99
98 325
11 34
66 8
1 9
10 4
99 1
325 98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment