18 October 2021, 20:39 | #1 |
Registered User
Join Date: Dec 2018
Location: Earth
Posts: 1,058
|
Is there a Tool to Sort This Script ?
Hi dear EAB Reader.
I search for a Tool to sort this Text below. (hole text attached) It´s the Setup Script for my Lazybench. If that would be alphabetically sorted, then Lazybench would be faster Can somebody name a Tool that let me do that ? Any Ideas Would be nice |
18 October 2021, 21:03 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
There is a sort command but I think it's buggy. It comes with the OS. What version of the OS are you running?
|
18 October 2021, 21:12 | #3 |
Registered User
Join Date: Jan 2013
Location: Wild South / Germany
Age: 48
Posts: 271
|
Linux command line hacking to the rescue
You can use this Linux command line to do the job: Code:
awk -F "/" '{print $NF"|"$0}' Lazybench.menu | sort -i | cut -d "|" -f 2- > Lazybench_sorted.menu - All lines of the input file Lazybench.menu will be passed to awk, one line after the other - awk will print out new lines, with the last field of every input line at the beginning of every new line, where "/" is the field delimiter in this command - sort -i will sort the output (meaning the newly created lines of awk) case insensitive - Last but not least, cut -d "|" -f 2- will cut off the mentioned "last field" value that awk pre-pended previously Happy hacking Edit: Attaching the sorted menu, just in case. Last edited by amigasith; 18 October 2021 at 21:18. |
18 October 2021, 21:19 | #4 |
Zone Friend
Join Date: Sep 2001
Location: Germany
Posts: 812
|
AFAIK, there is no way to sort this using AmigaOS' default tools. You would have to install some of the GNU text utilities to get this done.
How do you generate that list? It does not seem to contain readme files and stuff like that, so you're apparently not scanning for .info files? What you could do is: 1. generate a list of all .info files containing only the filenames (not tested, doublecheck the syntax before using it): Code:
list all files lformat="%s" pat="#?.info" 3. use a batch script that parses the list line by line and (a) locates the filename on disk (b) writes the full path to the file including the filename to a new textfile. The new textfile would then be the final list you use for Lazybench. |
18 October 2021, 21:32 | #5 | |
Registered User
Join Date: Dec 2018
Location: Earth
Posts: 1,058
|
Quote:
Linux is out of the question for me. (dont have it) The File is the "Config" for LazyBench. (it shows LazyBench the Location of my Games) . The File is just a standard Amiga Text file like the Startup-Sequence is. Would be neat if that Text would be sorted A-Z. Then LazyBench would not have to do it everytime @ Korodny I created it by Hand Yes !!! The Stuff seems so complicated Damn ,I think i am to stupid for that Never used the Sort command once in my Life |
|
18 October 2021, 21:46 | #6 | |
Registered User
Join Date: Dec 2018
Location: Earth
Posts: 1,058
|
Quote:
THAT WAS AMAZING !!!! THANK YOU SO MUCH !!!!!! ! That saved me from a Headache ! Thank you AmigaSith, you made Lazybench faster now !!! That´s so cool All the best to all the EAB People, youre always so nice and helpful ! Thank You ! [ Show youtube player ] Last edited by Torti-the-Smurf; 18 October 2021 at 21:47. Reason: Thanks again for the File , You did it !! I wanna say, Thank you ! |
|
18 October 2021, 21:54 | #7 |
Registered User
Join Date: Jan 2013
Location: Wild South / Germany
Age: 48
Posts: 271
|
No problem Glad I could help
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How was that tool called ? It reboots and execute a certain Script | Torti-the-Smurf | support.Apps | 8 | 27 November 2021 23:44 |
IconX - read tool types from script? | Sim085 | support.Apps | 15 | 26 August 2020 10:37 |
PFS-Defrag Tool - Need Script? | ahandyman59 | support.Apps | 2 | 28 April 2020 02:01 |
Script to update tool types of slaves for quit key? | emuola | project.WHDLoad | 17 | 15 March 2017 18:26 |
|
|