So what I'm trying to do is for this: looking at the example CSV:
After the script is run, the output should look similar to:
1,3917,3917,BGP=694,Y 1,3917,3917,Ethernet=1610,Y 1,3917,3917,LAG=3,Y
One line of original CSV file that contained additional delimiters is now converted into 3 lines because there were three additional fields within the 4th column.
I've been working on it all day and this is what I've come up with. Will it work?
#!/usr/bin/ksh if [ $# -ne 1 ]; then echo "Usage: read.sh filename"; exit 1; fi file="$1" while read line do IFS='|' set x $line while [ a -le #$] do a=a+1 echo "`$1`,`$a`" done done < $1