I have a set of .html files within a folder and I'm trying to look through each folder and extract a particular bit of info and store it into a CSV file.
Each file contains a similar line of data:
<h1><span class='noScreen'>Intranet:<br/></span>CLAS1206: Web Infrastructure (2019-2020)</h1><div class='pageContentBars0'><hr class='hide'/>
I'm trying to take the CLAS plus the following 4 numbers (different for each file) and take the class name "Web Infrastructure" (again different for each file) get achieve the following:
CLAS1206, Web Infrastructure(\n) CLAS1000, Mathematics(\n) CLAS2000, Science(\n)
Thus far I've managed to use the sed command to remove everything before CLAS but I have no idea where to go from here. I have the following in my script so far:
#!/bin/bash grep "<span class='noScreen'>" ./modules/CLAS1206.html | sed 's/^.*\(CLAS\)/\1/' | sed
which gives me the following output on the terminal
CLAS1206: Web Infrastructure (2019-2020)</h1><div class='pageContentBars0'><hr class='hide'/>
Any help on how to further break down this line and get it into the correct format would be appreciated!