Using CSV values to insert text

Published ยท Updated 10 Feb 2020

Here I am touching a few files to add a header to the markdown pages:

COUNT=1
while IFS=, read id name
do
	COUNT=`expr $COUNT + 1`
	if test "${name}"
	then
		#echo '\[\[!meta title="'${name}'"\]\]' >> general/$COUNT.mdwn
		sed -i "1i# ${name}" general/$COUNT.mdwn
	fi
done < titles.csv

I am assuming the ids are order for this silly example.