I have a wierd situatiion. My program below is setup to remove blank lines and seperate the data into 3 files, and replace the "\&" with a "&" in the 'Style' name. It does this successfully, however, if there is a "&" present in the data, it will lose the first line of data.
I've even tried it with this line and it didn't work. I still lost the first line of data when a "&" was present. Any advise?
program
tmpfile1
Thank you!
Snug
I've even tried it with this line and it didn't work. I still lost the first line of data when a "&" was present. Any advise?
Code:
style=`awk -F"|" 'NR=1 { print $2; exit 0 }' 1$$.2out`
program
Code:
tmpfile1="./"${basefile}.hdr
tmpfile2="./"${basefile}.det
ok_file="./"${basefile}.ok
#--------Get rid of blank lines
sed 's/^ *//g' ${basefile}.html | sed '/^$/d' > 1$$.1out
sed -e 's/<//g' -e 's/>/|/g' 1$$.1out >1$$.2out
style=`awk -F"|" 'NR=1 { print $2; exit 0 }' 1$$.2out | sed 's/\&/\&/g'`
styledes=`awk -F"|" 'NR=1 { print $3; exit 0 }' 1$$.2out `
echo "$basefile|$location|$style|$styledes|" >$tmpfile1
awk -F"|" 'NR !=1 { print $2 "|" $3 "|" $4 "|" $5 "|" $6 "|" $7 "|" }' 1$$.2out > $tmpfile2
tmpfile1
Code:
WESTRIDGE & KH.WESTRIDGE|2WTC1-WESTRIDGE|
SB36BUTT|1|789|Cabinets|0|1|
{NONE}|0|0|Cabinets|-1|1.1|
SB36BUTT|1|789|Cabinets|0|2|
{NONE}|0|0|Cabinets|-1|2.1|
SB36BUTT|1|789|Cabinets|0|3|
{NONE}|0|0|Cabinets|-1|3.1|
SB36BUTT|1|789|Cabinets|0|4|
{NONE}|0|0|Cabinets|-1|4.1|
Thank you!
Snug