I need to filter some lines from a file.
FileA looks similiar to:
4
34
1228
1776
2125
7054
7645
8845
FileB looks similiar to:
4
7054
8845
I need output to look like:
34
1228
1776
2125
7645
Basically, lines from fileA that are not in fileB
I've tried every conceivable uniq, sort, comm with no avail.
I'm thinking diff may be the tool but I just don't understand the output of diff.
I also tried:
for i in `cat fileA`
do
test `grep -v -w $i fileB` && echo "$i" >> FileC
done
but getting "test: too many arguments" error...
Thanks for any help.
FileA looks similiar to:
4
34
1228
1776
2125
7054
7645
8845
FileB looks similiar to:
4
7054
8845
I need output to look like:
34
1228
1776
2125
7645
Basically, lines from fileA that are not in fileB
I've tried every conceivable uniq, sort, comm with no avail.
I'm thinking diff may be the tool but I just don't understand the output of diff.
I also tried:
for i in `cat fileA`
do
test `grep -v -w $i fileB` && echo "$i" >> FileC
done
but getting "test: too many arguments" error...
Thanks for any help.