10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Im using code below comparing and getting the diff of two files.
But what about multiple files? can you help me guys
diff -u file1 file2|sed -n '/^---/!{/^-/s/-//p}'
diff -ui file1 file2| sed -n '/^++/!{/^+/s/+//p}'
Example
File1:
aaa
bbb
ccc
ddd
File2:
bbb
eee (5 Replies)
Discussion started by: kenshinhimura
5 Replies
2. Shell Programming and Scripting
Dear All,
I am trying to write a Unix Script which fires a sql query. The output of the sql query gives multiple rows. Each row should be saved in a separate Unix File.
The number of rows of sql output can be variable. I am able save all the rows in one file but in separate files.
Any... (14 Replies)
Discussion started by: Rahul_Bhasin
14 Replies
3. Shell Programming and Scripting
I have this code
awk 'NR==FNR{a=$1;next} a' file1 file2
which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones... (7 Replies)
Discussion started by: castrojc
7 Replies
4. Shell Programming and Scripting
Hi,
I need to compare multiple columns from 2 files.
I can, for example, have these 2 files:
file1:
col1, col2, col3,col4
a,1,4,7
b,2,5,8
c,3,6,9file2:
col1, col2, col3,col4
a,2,3,2
b,5,7,5
c,1,9,8As a result, I need for example the difference between the columns 2 and 4:
col2,... (3 Replies)
Discussion started by: Subbeh
3 Replies
5. Shell Programming and Scripting
Hi,
input file1
abcd 123 198 xyz1:0909090-0909091
ghij 234 999 xyz2:987654:987655
kilo 7890 7990 xyz3:12345-12357
prem 9 112 xyz5:97-1134
input file2
abcd 123 198 xyz1:0909090-0909091 -9.122 0
abed 88 98 xyz1:98989-090808 -1.234 1.345
ghij 234 999 xyz2:987654:987655 -10.87090909 5... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
6. Shell Programming and Scripting
Hi all,
i have 50 files .data should be same in these 50 files , so my task is to find the difference. i need a logic , which finds difference between all files and print in output file with file name where it found that difference .
i tried below logic , but its not giving me what i want.
let... (2 Replies)
Discussion started by: deepakiniimt
2 Replies
7. Shell Programming and Scripting
Hi friends,
I have multiple files. For now, let's say I have two of the following style
cat 1.txt
cat 2.txt
output.txt
Please note that my files are not sorted and in the output file I need another extra column that says the file from which it is coming. I have more than 100... (19 Replies)
Discussion started by: jacobs.smith
19 Replies
8. Shell Programming and Scripting
Hello Everyone,
I have strange situation and unable to think of a solution. Situation is as follow,
FolderA contrain following files,
File1
File2
File3
File4
I want to compare as follow
compare File1 with File2 --> Result Same/Diffrent
compare File1 with File3 --> Result... (1 Reply)
Discussion started by: ZalimJin
1 Replies
9. Shell Programming and Scripting
Hi
I have a requirement to process number of files matching a criteria. The resulted file would be processed indivdually looking for a particular string until another one found lines afterwards. Then look for the occurrence of another string in the result count and display/return the result. ... (13 Replies)
Discussion started by: arungn
13 Replies
10. Shell Programming and Scripting
hello
I need to compare 2 text files. File 1 has 2 columns and file 2 has 1 to many.
Sample:
File 1:
111 555
222 666
333 777
444 755
File 2:
000 110 113 114
844 111 555 999
202 777 865 098 023
222 313 499
065 655 333 011 890 777
433 (15 Replies)
Discussion started by: stevesmith
15 Replies