dear anbu23,
thanks a lot...
but can you please explain me your code?
Thankx,
Regards,
Above code doesn't work. Try this NR == FNR { arr[$1]=1; next } Keep first field as index and assign one to it. This block is executed till the end of first file.
!arr[substr($3, length($3)-2)] { print "Error" ;exit } Get the last three digit of third field and check whether it is an index in array arr. If not exit the processing.
Hi All,
I am a newbie to Shell scripting. Please help me with the Following problem,
1. I have two files with the same name in different locations in the same machine.
Eg: /root/testfolder/a ---- location 1
/tmp/testfolder/a ----- location 2
2. I want to compare the files in... (5 Replies)
Hello All,
I am writting file comparison Utility and I have encountered such a senario where there are 2 files such as follows-
1#!/usr/local/bin/python
2 import gsd.scripts.admin.control.gsdPageEscalate
3.gsd.scripts.admin.control.gsdPageEscalate.main()
1 #!/usr/local/bin/python... (10 Replies)
i have 2 files and i want to compare
i currently cat the files and awk print $1, $2 and doing if file1=file2 then fail, else exit 0
what i want to do is compare values, with column 1 being a reference i want to compare line by line and then still be able to do if then statement to see if worked... (1 Reply)
Hello all,
I always found help for my problems using the search option, but this time my request is too specific. I have two files that I want to compare. File1 is the index and File2 contains the data:
File1:
chr1 protein_coding exon 500 600 . + . gene_id "20532";... (0 Replies)
Hello,
Please help me with this problem if you have a solution.
I have two files:
<file1> : In each line, first word is an Id and then other words that belong to this Id
piMN-1 abc pqr xyz py12
niLM y12 FY4 pqs
fiRLym F12 kite red
<file2> : same as file1, but can have extra lds... (3 Replies)
Total UNIX Rookie, but I'm learning. I have columns of integer data separated by spaces, and I'm using a Mac terminal.
What I want to do:
1. Compare "line 1 column 2" (x) to "line 2 column 2" (y); is y-x>=100?
2. If yes, display difference and y's line number
3. If no, increment x and y by... (9 Replies)
Hello I'm having a little difficulty in writing a shell script for a few simple tasks.
First I have two files "file1.txt" and "file2.txt" and I want to read and compare the last line of each file. The files look like this.
File1.txt
File2.txt
After comparing the two lines I would... (2 Replies)
Hello all- New to this forum, and relatively new to using grep at the Terminal command line to work with regular expressions. I've got a background in math and some programming experience, so it's not been too difficult to learn the basics of searching through my word lists for particular types of... (13 Replies)
Hello,
I would like to write a /bin/ksh script to manipulate a file and compare its contexts. Comparing lines 1 & 2, 3 & 4, 5 & 6, and so forth until the end of the file. This is what I would like the script to compare (using line 1 & 2 as an example):
1. Verify if the last column in line 1 is... (10 Replies)