Article 4TQBP bash: diff ignoring certain columns

bash: diff ignoring certain columns

by
schneidz
from LinuxQuestions.org on (#4TQBP)
[a.i.x.]:

Code:cat s1.lst
chun-li,hello,0451,world
cat s2.lst
ryu-ken,hello,0000,worldi would want to ignore the 1st and 3rd columns (the byte-offsets are alwaze the same).

i have two files with about 30 columns (one has 39,952 rows; the other has 40,215) and i wanna' compare which serial-numbers (last column) have different data (date, time, processor, ... fields will always be different).

i dont have gnu extentions but i do have access to a c compiler.

maybeCode:cat serial.number | while read serial
do
grep $serial s1.lst | cut -b 100-125,134- > s1.buff
grep $serial s2.lst | cut -b 100-125,134- > s2.buff
diff s1.buff s2.buff
done > report.lstwill work ?latest?d=yIl2AUoC8zA latest?i=YIzgBzQswFw:O51pV27p5KU:F7zBnMy latest?i=YIzgBzQswFw:O51pV27p5KU:V_sGLiP latest?d=qj6IDK7rITs latest?i=YIzgBzQswFw:O51pV27p5KU:gIN9vFwYIzgBzQswFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments