Unix – grep, sort , uniq

Source File

cat genre.txt
./014/735/54/00000000000001473554.xml
          
./014/735/10/00000000000001473510.xml
          
./014/726/18/00000000000001472618.xml
          
./014/726/26/00000000000001472626.xml
          
./014/726/08/00000000000001472608.xml
          
./014/726/42/00000000000001472642.xml
          
grep Genre genre.txt |sed 's/.*Genre name="\(.*\).>.*/\1/g'|sort|uniq –c
grep Genre genre.txt |sed 's/.*Genre name="\(.*\).>.*/\1/g'\
|sort|uniq -c|awk '{ print $2"\t"$1 }'|sort |sed 's/&apos//g'
grep Genre genre.txt |sed 's/.*Genre name="\(.*\).>.*/\1/g’

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *