Hi, I want to check out a word in the text file and generate a clear report for me to see...
The text file content:
Content:
............
20120608: [TXT 120k-130k(130k), manachan]
20120608: [TXT 120k-130k(130k), natsumi]
............
20120608: [Full TxT 120k-130k(130k), manatsu]
..........
2012031201: [TXT 350k-540k(600k)], hime]
End of the file
My expected output is:
Full TXT:
manatsu
TXT:
manachan
natsumi
hime
I got some trouble to get "TXT" and "Full TXT" now and I am not idea to sum up all the TXT info. Is it possible to generate?
#!/bin/ksh
for i in `sed -e "s/[ <tab>]*//g" record1 | grep -i 'TXT'`
do
txtName=`echo $i | awk 'BEGIN {FS=","} {print $1;}'`
if [ -n `$txtName | grep -i 'Full TXT' ]
author=`echo $i | awk 'BEGIN {FS=","} {print $2;}'`
echo "Full Text: $author"
fi
done
exit
but it will have an error message (red color)
grep: can't open 20120608: [Full TxT 120k-130k(130k), manatsu]
Thanks!