Skip to main content

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

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account