Bash: Script to make indexes from csv & md files

interpretive language scripts


Moderator: Forum moderators

Post Reply
User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Bash: Script to make indexes from csv & md files

Post by puppy_apprentice »

I've made some scripts that make indexes from csv files:
viewtopic.php?p=41407#p41407
Added another one for md files:

Code: Select all

#!/bin/sh
#by puppy_apprentice
IFS=','
echo -e "# Java Apps Index\n"
echo "_Last update: $(date)_"
while read -r line || [ -n "$line" ]
do
	array=($line)
	category=${array[0]}
	name=${array[1]}
	link=${array[2]}
	if [[ $categories != *"$category"* ]]; then
	categories+="$category,"
	fi
	declare md_body_$category+="* [$name]($link)\n"
	
done < $1
for cat in $categories
do
temp=md_body_$cat
echo -e "### $cat\n${!temp}"
done
Attachments
indexes-scripts.zip
(2.25 KiB) Downloaded 41 times
java-apps.md.png
java-apps.md.png (22.85 KiB) Viewed 465 times
Last edited by Flash on Fri Dec 03, 2021 1:31 am, edited 1 time in total.
Reason: Original title: Indexes scripts
Post Reply

Return to “Scripts”