Thursday, 15 March 2012

string - bash remove the same in file -


itemprop = "text">

I have a problem getting different strings.

I have two files, for example:

File 1:

aaa1

aaa4

BBB3

ccc2

and

file 2:

BBB3

CCC 2

aaa4

How to get value of this value 1 (in this case due to aaa1 string)?

I have a query but it does not only count different strings, they also keep the order of the lines in mind.

  diff file1 file2 | Grep "& lt;" | Wc -l  

Thanks.

you grep-v-c with other options as follows:

  grep -cvwFf file2 file1 1  

The options used are:

  -c - Match count -V - Invert matches- w- Full word match (to avoid partial matches) -F - Fixed string match -f - Use a file for matching pattern  

No comments:

Post a Comment