Only print the match part.
grep -A num
Print num lines after the match
grep "\<" match the empty string at the beginning
of the word
$ echo "so happy i am " | grep -o "\
happy
echo -e "\t"
Show special chars in script string.
cut -s
do not print lines not containing delimiters
#!/bin/bash
for file in $(ls *.html)
do
match=$(perl parse.pl $file | grep -A 1 Manufacturer:)
manu=$(echo $match | grep -w -o Manufacturer:.*Mfr | sed 's/Manufacturer://g'| sed 's/M
fr//g')
date=$(echo $match | grep -w -o "Date:.*NHTSA CAMPAIGN"| sed 's/Date://g'| sed 's/NHTSA
CAMPAIGN//g')
comp=$(echo $match | grep -w -o Component:.*Potential | sed 's/Component: //g'| sed 's/
Potential//g')
num=$(echo $match | grep -w -o Affected:.*Summary | sed 's/Affected: //g'| sed 's/Summa
ry//g')
echo -e "$manu\t$comp\t$num\t$date" >> table
done
# file1="${file%.html}.txt"
# echo $file1
# manu=$(grep "Manufacturer:" $newfile| cut -d":" -s -f 2)
# date=$(grep "ReportDate:" $newfile| cut -b 19-32)
# date=$(grep "ReportDate:" $newfile| cut -b 19-32)
# comp=$(grep "Component:" $newfile|sed 's/Component:/\t/g' |)
No comments:
Post a Comment