Skip to main content

All Questions

1 vote
1 answer
2k views

diff marking each line as old, new, or unchanged

I need to diff two unsorted text files with the output marking every line as either old, new, or unchanged. The marks should appear at the beginning or end of the line, and there should be no other ...
Psychonaut's user avatar
3 votes
1 answer
708 views

How to highlight output from diff command and make them side by side?

I have two files $ cat file1.txt UUXX:1 UUXX:2 $ cat file2.txt UUXX:3 UUXX:1 I want to use this command $ diff --old-group-format=$'\e[0;31m%<\e[0m' --new-group-format=$'\e[0;31m%>\e[0m' --...
Noor's user avatar
  • 31
4 votes
2 answers
2k views

Bash Script for showing difference between two text files

Lets say I have two lists: guests-2016.txt: Peter Michael Frank Dirk guests-2017.txt: Mark Michael Dirk Lilly How may I create two new lists of guests Guests that were in guests-2016.txt but are ...
NoobieNoob's user avatar
2 votes
1 answer
2k views

Comparing two files and writing mismatched rows along with mismatched columns. Pointing out the mismatched columns is my main problem statement

I got a requirement where I need to compare two files wrt to each columns and write the corresponding difference in another file along with some identification showing mismatched columns. Pointing out ...
piyush's user avatar
  • 123
0 votes
1 answer
37 views

Error messages are not getting displayed while comparing the datatypes from 2 files in shell script

We have a requirement to compare the datatypes. I have created .txt files with datatypes and wrote a query to get the datatypes from the netezza system table (we are using netezza database) and ...
Samah's user avatar
  • 3
2 votes
2 answers
3k views

differentiating two files and getting the unique output in third one

I'm very new to shell scripting and learning it now. I have two files. File 1: 1 StartInstall, CDM_2.5B263, OK 2 EndInstall, CDM_2.5B263, SUCCESS 3 StartPatch, CDM_2.5.0.2B1, OK ...
Parul kusmatia's user avatar
5 votes
2 answers
771 views

Search directories for multi line string

Looking for a way to recursively search a repository for all files containing a multi line string and return the file names that contain it. The paragraph is just a header approx 30 lines. So I know ...
Gooner1990's user avatar
3 votes
2 answers
901 views

Find differences in file and sorting file by key

So I have two language files, english and french. They are in this format: key=translation An example in English would be: ui.title=My Title And in French: ui.title=Mon Titre So I need a script ...
Chris Smith's user avatar
3 votes
3 answers
4k views

compare files line by line and create new one bash programming

I have two text files. File 2 has logs over 1,000,000. File 1 has IP addresses line by line. I want to read file 2 lines and search these lines in file 1, I mean: file 1: 34.123.21.32 45.231.43.21 ...
DessCnk's user avatar
  • 33
3 votes
1 answer
2k views

Reading two files into an IFS while loop -- Is there a way to get a zero diff result in this case?

I have a text file full of several hundred lines of sequences like this: b 29. b 52. c 84. c 83. c 94. c 93. c 61. b 38. c 81. c 92. c 28. c 37. c ...
ixtmixilix's user avatar
  • 13.5k