Thread: Comparing text files
hello,
have 2 text files. both contain list of file names , hashes.
wish compare file names , respective hashes file against file b.
want compare file names .jpg extension, think have use cut extract lines .jpg in them before can compare them against file b.
command suggested me :
cut -f 1 -d ' ' filea.txt > fileacut.txt
grep -v -f fileacut.txt fileb.txt
i'm guessing somewhere in cut command have insert *.jpg extension i'm not sure goes.
appreciated, thank you.
hello,
first create file contains file names *.jpg , sort alphabetical order:
grep '.jpg' filea.txt | sort > fileacut.txt
grep '.jpg' fileb.txt | sort > filebcut.txt
compare 2 files diff:
diff -ac filacut.txt filebcut.txt
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Comparing text files
Ubuntu
Comments
Post a Comment