in reply to Re^3: Filtering Output from two files
in thread Filtering Output from two files

The file has around 7 lakh lines so yeah :p

Replies are listed 'Best First'.
Re^5: Filtering Output from two files
by AnomalousMonk (Archbishop) on Feb 04, 2018 at 16:18 UTC

    If your File1 has 700,000 lines, rest assured that a hash can easily accommodate this number of lines or even many more — if the lines are sufficiently short, i.e., not thousands of characters!

    One pitfall to avoid: When you read each line from your File1, it will have some kind of line-end delimiter, typically a newline. This will have to be removed (see chomp) before adding it to the lookup hash because a COA213345 field split from the beginning of a line in File2 will have no such delimiter. (Looking up a key in a hash (see exists) is essentially an  eq string exact equality operation.)

    Perhaps take a look at some of the articles in the Input and Output section of the Monastery's Tutorials.


    Give a man a fish:  <%-{-{-{-<

Re^5: Filtering Output from two files
by LanX (Saint) on Feb 04, 2018 at 17:45 UTC
    Lakh is not really a standard English word!

    Maybe you should show some efforts in programing AND your communication skills?

    So yeah :p

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

    PS: We are still happy to help you fixing code, as soon as you show some.

      Lakh is not a standard (update: or even familiar) Brit/Yank English word, but is perfectly cromulent Indian English. (And when you consider that there may be more speakers of Indian English as a first/second language than there are B/Y first language speakers... :)

      P.S.: And yes, it would be nice to see some code!


      Give a man a fish:  <%-{-{-{-<

        Cromlulent English?

        OMG, and I also did not know lakh, I'm afraid I'll never master English well enough. :(

        Standard English means (at least for me) being understood world wide.

        I'd also complain about any Texan, Geordie or Outback slang.

        And yes I knew lakh already, I don't see the point in obliging most readers here to look it up in a dictionary.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Wikisyntax for the Monastery