This isn't very idiomatic Perl, but should hopefully be enough to get you started. The trickery with $n and ARGV is to simulate the awk NR==FNR idiom. The eof thing is to reset line numbers in $. when the file changes; see the eof documentation for a brief discussion.
By the way, $3 in 6515152 52272 * ConstMethodKlass is just "*" -- maybe you want to normalize that, rather than change the script.
I have made several attempts to read two files of ip addresses and eliminate records from file1 that are in file2.
My latest attempt follows. Everything works except my file3 is exactly the same as file1 and it should not be.
# !/usr/bin/bash
#
# NoInterfaces
# Utility will create a file... (8 Replies)
Hi i have a file and i want to add the coloum values
like
9067 is coming twice here so o/p willbe like
9067,sum of 3rd coloum,sum of 4th coloum
9015 is coming 0nce then o/p
9015,15,6
sum is happening based on first coloum it will add all the third coloum and 4th coloum value where first... (1 Reply)
Hi
I've been trying various methods that I have found online with regards to comparing 2 files using the diff command. Nothing seems to work. The problem is that I'm not too familiar with the proper syntax. Can you please assist me. Here is my script:
#!/bin/bash
awk -F',' -v file1="$1"... (9 Replies)
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... (1 Reply)
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)
Hi Friends Need your expertise.
Command to check the difference and compare 2 files and remove lines . example
File1 is master copy and File2 is a slave copy . whenever i change, add or delete a record in File1 it should update the same in slave copy . Can you guide me how can i accomplish... (3 Replies)
I am having two csv files i need to compare these files and the output file should have the information of the differences at the field level.
For Example,
File 1:
A,B,C,D,E,F
1,2,3,4,5,6
File 2:
A,C,B,D,E,F
1,2,4,5,5,6
out put file: (12 Replies)
Assitance needed in checking file difference using a perl script
Below is the example
I wanted a report saying file2 has an update of new value.
File1 old date
Alpha 156
Beta 255
Gama 6987
segma 4578
File2 new date
Alpha 156
Beta 255
Gama 1000 (3 Replies)