![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help to modify perl script: Text file with line and more than 1 space | srsahu75 | Shell Programming and Scripting | 3 | 03-20-2009 05:28 PM |
| Perl/shell script count the lines | pistachio | UNIX for Dummies Questions & Answers | 3 | 09-24-2008 05:26 PM |
| HELP! PERL script to find matched pattern | kimhuat | Shell Programming and Scripting | 1 | 05-12-2008 11:24 AM |
| Perl Script Error with find command | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 12:02 PM |
| Modify Perl script to work with txt - Permissions script | joangopan | Shell Programming and Scripting | 1 | 09-13-2007 12:38 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Modify a perl script to find and count
Hello all !I have two sets of folders that have IP address from two sources.The below perl script I was working with needs some corrections.I am looking for the perl script to identify and count what IP address are found to be duplicated between both files.The format from both files are the same meaning IP addresses100.100.100.2
I am hopefull to get a report like so: The report should contain a list of objects found in both datasets. For example: "The following objects were found in both file A and File B: 10.1.1.1 10.2.2.1 With what I have I noticeing an error off the bat. Mind you I am not an expert in perl syntax error at E:\dup2.pl line 10, near "print"Execution of E:\dup2.pl aborted due to compilation errors. Thanks #!perl @ARGV=<E://rich//file-A-obj_prof.out.txt E://rich2//File-B-obj_prof-out.txt *>; while( <> ){ next if /^#/; print if $count{(split)[-1]}{$ARGV}++; } my %in; push @{$in{join' and ',sort keys %{$count{$_}}}},$_ for sort grep{%{$count{$_}} > 1} keys %count print join"\n","the following files appear in $_",@{$in{$_}},"" for keys %in; Last edited by richsark; 03-31-2009 at 12:47 PM.. Reason: text format |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|