sort clipboard

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
webber123456
Newbie
Posts: 11
Joined: Thu Aug 04, 2005 10:06 pm

sort clipboard

Post by webber123456 » Fri Aug 19, 2005 8:42 pm

How might I sort the clipboard contents and return the sorted result into the clipbord so I can then paste the result into an active document ?
________
OXYGEN VAPORIZER
Last edited by webber123456 on Thu Feb 10, 2011 9:37 pm, edited 1 time in total.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Aug 19, 2005 9:29 pm

You could use a bubble sort algorithm or similar. Google "bubble sort".
MJT Net Support
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Aug 19, 2005 9:51 pm

Try something like this:

GCB>tosort
WriteLn>%TEMP_DIR%~tempsort~.txt,result,tosort
Let>RP_WAIT=1
Let>RP_WINDOWMODE=2
Run>cmd /c sort %TEMP_DIR%~tempsort~.txt /O %TEMP_DIR%~tempsorted~.txt
Let>RP_WAIT=0
Let>RP_WINDOWMODE=1
Readfile>%TEMP_DIR%~tempsorted~.txt,sorted
Put>sorted
DeleteFile>%TEMP_DIR%~tempsort~.txt
DeleteFile>%TEMP_DIR%~tempsorted~.txt

Hope this helps,
Dick

Edit-1
For some reason this would lock up occasionally. I removed the percents (%) from around the "tosort" variable in the second line and also from the "sorted" variable in the ninth line. It seems to function now without locking up.

Sorry if this inconvenienced anybody,
Dick

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts