File compare and diff

Discussion in 'Perl Misc' started by timgerr()@()gmail.com, Oct 3, 2005.

  1. Here is a queston that I have for ya'all. I want to search 2 text
    files, example_A.txt and example_B.txt. I want to run a script that
    will say that file example_B.txt has 1 more line than exampleA.txt
    does, any ideas???
    Thanks for the help

    Here are 2 example files that I am going to compair.

    example_A.txt =
    11/28/1999 || 1:00:00 AM || 1:00:00 AM || 1:00:00 AM || duration ||
    Meet Tom
    11/24/2003 || 4:00:00 PM || 5:00:00 PM || 5:00:00 PM || duration || FW:
    RFQ / GPI Pricing refresh activity & Organizational Change Announcement

    11/25/2003 || 9:00:00 AM || 9:30:00 AM || 9:30:00 AM || duration ||
    ISDN Install


    example_B.txt
    11/28/1999 || 1:00:00 AM || 1:00:00 AM || 1:00:00 AM || duration ||
    Meet Tom
    11/24/2003 || 4:00:00 PM || 5:00:00 PM || 5:00:00 PM || duration || FW:
    RFQ / GPI Pricing refresh activity & Organizational Change Announcement
    11/25/2003 || 9:00:00 AM || 9:30:00 AM || 9:30:00 AM || duration ||
    ISDN Install
    12/13/2004 || 11:00:00 AM || 12:00:00 PM || 12:00:00 PM || duration ||
    Discuss Move of IT Room || || || 15
     
    timgerr()@()gmail.com, Oct 3, 2005
    #1
    1. Advertising

  2. timgerr()@()gmail.com

    Paul Lalli Guest

    timgerr()@()gmail.com wrote:
    > Here is a queston that I have for ya'all. I want to search 2 text
    > files, example_A.txt and example_B.txt. I want to run a script that
    > will say that file example_B.txt has 1 more line than exampleA.txt
    > does, any ideas???
    > Thanks for the help


    Is that really the only thing you want to compare about the two files?
    If that's the case:
    $ perldoc -q lines
    Found in /opt/perl/lib/5.6.1/pod/perlfaq5.pod
    How do I count the number of lines in a file?

    If you want to do an actual `diff` on the two files to see exactly how
    they differ, take a look at:
    Algorithm::Diff and Text::Diff, both available from
    http://search.cpan.org

    Paul Lalli
     
    Paul Lalli, Oct 3, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cyril Vi?ville

    diff Process under diff users

    Cyril Vi?ville, Jun 29, 2004, in forum: Perl
    Replies:
    1
    Views:
    514
    Joe Smith
    Jun 29, 2004
  2. Berrucho
    Replies:
    2
    Views:
    647
    Infant Newbie
    Dec 5, 2003
  3. A Traveler

    Diff CSS styles for diff INPUT TYPE='s?

    A Traveler, Aug 31, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,934
    Steve Fulton
    Aug 31, 2004
  4. edw
    Replies:
    2
    Views:
    9,486
  5. Austin Ziegler

    [ANN] Diff::LCS 1.1.0, Diff::LCS 1.0.4

    Austin Ziegler, Aug 8, 2004, in forum: Ruby
    Replies:
    3
    Views:
    197
    Austin Ziegler
    Aug 9, 2004
Loading...

Share This Page