I am working on a script to convert a comma seperated text file into html code line by line.
I am a newbie with scripts (and programming in general)
The text file is like so:
Code:
link url, image url, description
and I want it to output this:
Code:
<td><a href=”link url”><img src="image url" alt=”description" /></a></td>
Here is what I have so far:
Code:
#!/bin/bash
var1='<td><a href=”'
var2='”><img src="'
var3='" alt=”thumbnail image" /></a></td>'
while read line
do
echo $var1$line$var2$line$var3
done < gallery.txt
It puts the entire line into the html so its no good. I'll probably need to use awk (I think).