hi,
As such I am new to perl on google search I found a code for Perl script to compare two files and print differences between them and instead of prinintg I want to store the diff. in a outputfile so can sombody provide assistance upon this from where can I edit in script to store the diff in output file..
Moderator's Comments:
[TABLE] isn't suitable for [CODE]. And correctly formatting your code increases readability a lot
---------- Post updated at 07:45 AM ---------- Previous update was at 07:16 AM ----------
Hi,
Apart from above script I found one more script which will save the diff. in output file.
Suppose a.txt file
315: posedge SYS_CLK_IR)
^^^^^^^
vx1_bit_align.v:315: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
170: posedge RD_CLK_IR)
^^^^^^^
vx1_ff_dpram.v:170: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
202: posedge RD_CLK_IR)
^^^^^^^
vx1_fifo_ctrl.v:202: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
267: posedge PIXEL_CLK_IR)
^^^^^^^
vx1_resizer.v:267: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
and the second file is a.txt
170: posedge RD_CLK_IR)
^^^^^^^
vx1_ff_dpram.v:170: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
and the diff. of these two will be save in ouput file 1.txt is
vx1_resizer.v:267: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
315: posedge SYS_CLK_IR)
vx1_fifo_ctrl.v:202: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
vx1_bit_align.v:315: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
267: posedge PIXEL_CLK_IR)
202: posedge RD_CLK_IR)
From output file I canclude its printing the diff of these two file in a random manner not in proper sequence as such in input file.so please help me where is error in code because diff of file is printed randomly.
Hope so I cleared my Problem.
---------- Post updated at 07:46 AM ---------- Previous update was at 07:45 AM ----------
Hi,
Apart from above script I found one more script which will save the diff. in output file.
Suppose a.txt file
315: posedge SYS_CLK_IR)
^^^^^^^
vx1_bit_align.v:315: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
170: posedge RD_CLK_IR)
^^^^^^^
vx1_ff_dpram.v:170: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
202: posedge RD_CLK_IR)
^^^^^^^
vx1_fifo_ctrl.v:202: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
Coding Standard
267: posedge PIXEL_CLK_IR)
^^^^^^^
vx1_resizer.v:267: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
and the second file is 2.txt
170: posedge RD_CLK_IR)
^^^^^^^
vx1_ff_dpram.v:170: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
and the diff. of these two will be save in ouput file 1.txt is
vx1_resizer.v:267: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
315: posedge SYS_CLK_IR)
vx1_fifo_ctrl.v:202: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
vx1_bit_align.v:315: CLOCKS> [WARNING] B_1202: 2 clocks in this unit detected
267: posedge PIXEL_CLK_IR)
202: posedge RD_CLK_IR)
From output file I canclude its printing the diff of these two file in a random manner not in proper sequence as such in input file.so please help me where is error in code because diff of file is printed randomly.
Hope so I cleared my Problem.
... instead of prinintg I want to store the diff. in a outputfile ...
...
The code snippet in your post about the meaning of "unless" had the print command to print to an output file. Have a look at that.
Also check the Perl documentation for the "print" function.
I would really appreciate any assistance that I can get here.
I am fairly new to perl. I am trying to rewrite my shell scripts to perl.
Currently I have a shell script (using sed, awk, grep, etc) that gets a list of all of the zone files in a directory and then looks in named.conf for what... (0 Replies)
Hi dear users,
I need to compare numeric columns in two files. These files have the following structure.
K.txt (4 columns)
A001 chr21 9805831 9846011
A002 chr21 9806202 9846263
A003 chr21 9887188 9988593
A003 chr21 9887188 ... (2 Replies)
Hi
I have file 1 like this:
file 2 is like this:
The files are tab separated. I want to search for the first column values of file 1 in the first column of file 2 and merge the 3rd column value of file 2 to the corresponding line on first file.
so the desired output is;
I tried following... (2 Replies)
Need perl script to compare the two CSV files and and give out put in CSV format
File MsPMTP.csv
File ProfileNames.csv
MsPMTP.csv is having lines like below
JBL_VIJ_A_A962/r01sr4sl12/port#01-#13-Au4P-4c-TMi-PMNETR15
JBL_VIJ_A_A962/r01sr4sl12/port#01-#13-Au4P-4c-TMi-PMFETR15... (9 Replies)
Folks I need your help cuz I've a file with 100,000 records that need to be compared against a passwd file (300) and then create a third one with the data in the first one and the passwd from the second one set in it.
The format of the first file is:
host xxxxxx "" 0,0 Closed control00/... (4 Replies)
Hello guys,
I have written a script which will differentiate between two baseline in UCM:
The two baseline is passed as an argument from command line.
Now i can see the output in a .txt file,where it will give you the ouput in this way.....
... (2 Replies)
Is there a way to compare two floating points numbers in a bash script using perl? I've tried just using a bash if statement and it doesn't seem to support floating point numbers. Can the perl line read vars from bash then output a var to bash?
a=1.1 #from bash
b=1.5 #from bash
if... (3 Replies)
I need to compare 2 csv files and report should containg number of matching lines,different lines ,missing lines in one file using perl.
I dont want to use read line by line and scan thru the second file for matching line ,as this logic was so time consuming .Can other ideas .please respond asap... (2 Replies)
need to compare 2 csv files and report should containg number of matching lines,different lines ,missing lines in one file using perl.
I dont want to use read line by line and scan thru the second file for matching line ,as this logic was so time consuming .Any ideas.i need the soultion badly .... (2 Replies)
Hi,
i am new to perl scripting.. i am still learing it.. i am asked to write a perl script which should compare 2 coloums of 2 different files. if those 2 coloumn are same the script should store the both the lines in 2 diff files.
these are files,
file 1:
21767016 226112 char
19136520... (3 Replies)