Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Thank you for your reply and code modification. As I said I am new to Perl and am not familiar with some of the code you provided.

I am including a sample interval of the files I am evaluating.

First file:

00:00:01 Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hd4 262144 102228 159916 39% / /dev/hd2 2359296 2243384 115912 96% /usr /dev/hd9var 1048576 199528 849048 20% /var /dev/hd3 1048576 8240 1040336 1% /tmp /dev/hd1 2097152 41140 2056012 2% /home /proc - - - - /proc /dev/hd10opt 524288 206640 317648 40% /opt /dev/ts1000 262144 716 261428 1% /usr/local /dev/ts1001 6291456 5967256 324200 95% /banktools /dev/ts1002 786432 448 785984 1% /stage /dev/ap1001 20971520 11231912 9739608 54% /oracle /dev/ap1002 36700160 11310284 25389876 31% /ora01/oradata /dev/ap1003 36700160 13372456 23327704 37% /ora02/oradata /dev/ap1004 31457280 5995712 25461568 20% /ora03/oradata /dev/ap1005 20971520 11067000 9904520 53% /ora04/oradata /dev/ap1006 26214400 23716476 2497924 91% /ora05/oradata /dev/ap1007 26214400 15031656 11182744 58% /ora06/oradata /dev/ap1008 20971520 17307236 3664284 83% /ora01/orabkup /dev/ap1009 209715200 35552472 174162728 17% /ora01/oraflash

Second file:

23:00:00 Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hd4 262144 102484 159660 40% / /dev/hd2 2359296 2243384 115912 96% /usr /dev/hd9var 1048576 197148 851428 19% /var /dev/hd3 1048576 8928 1039648 1% /tmp /dev/hd1 2097152 40956 2056196 2% /home /proc - - - - /proc /dev/hd10opt 524288 206820 317468 40% /opt /dev/ts1000 262144 716 261428 1% /usr/local /dev/ts1001 6291456 6093220 198236 97% /banktools /dev/ts1002 786432 448 785984 1% /stage /dev/ap1001 20971520 11312864 9658656 54% /oracle /dev/ap1002 36700160 11310284 25389876 31% /ora01/oradata /dev/ap1003 36700160 13372456 23327704 37% /ora02/oradata /dev/ap1004 31457280 5995712 25461568 20% /ora03/oradata /dev/ap1005 20971520 11067000 9904520 53% /ora04/oradata /dev/ap1006 26214400 23716476 2497924 91% /ora05/oradata /dev/ap1007 26214400 15031656 11182744 58% /ora06/oradata /dev/ap1008 20971520 17307236 3664284 83% /ora01/orabkup /dev/ap1009 209715200 35552472 174162728 17% /ora01/oraflash

You guessed correctly in understanding my desire to read each line of both files and compare the matching mount points and produce a single line of output to a .csv file for each mount point, that includes the total, used and free disk for both the beginning file and end file.

I have a question regarding the subroutine consume that you created. Does it read in a single line of the first file and perform the formatting before reading in a single line of the second file, or are all lines of the first file read and formatted before the second file is called?

The reason I ask is due to the fact that my desired output is a single line of data for each mount point listed that would include the total, used and free space of each file.

Sorry if my question is confusing. I have only been using Perl for two weeks and have been self taught.

Thanks for your cooperation.


In reply to Re^2: Reading in two text files by Spartan4ever
in thread Reading in two text files by Spartan4ever

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (8)
    As of 2014-08-23 18:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (177 votes), past polls