Being a compulsive list person, I was looking for a way of sorting my lists more automatically by tagging single lines or sections and letting a program sort through and reorganize the list depending on the tags.
This program will take a single file argument and use the following tags to organize the content to a file 'list.out'. Untagged content is left at the top of the file as is. The 'XX' represents a category number either zero '01' or space padded ' 1'. Note to include a space character after the 'XX' as this is truncated from the output list also.
#tags used
>>>>cahXX #category header number XX
>>>catXX #single line category entry
<<<<catXX #section open category entry
>>>> #section close category entry
Change the $cat_total and @list_order to change the total number of categories and the order they are output. Empty categories are not printed.
#sample input file start
>>>>cah01 home
>>>cat01 home
>>>cat01 ====================================
>>>>cah02 pets
>>>cat02 pets
>>>cat02 ====================================
<<<<cat01
get milk
tomatoes
>>>>
>>>cat02 feed cats
unmarked text
<<<<cat02
feed dogs
obedience training
>>>>
more unmarked text
>>>cat01 do laundry
#sample input file end
#output file start
unmarked text
more unmarked text
>>>>cah 1 home
>>>>cah 2 pets
<<<<cat 1
home
====================================
get milk
tomatoes
do laundry
>>>>
<<<<cat 2
pets
====================================
feed cats
feed dogs
obedience training
>>>>
#output file end
--
JeremyCothran - 30 Aug 2025
to top