Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Sorry. That was a horrible way to ask for help on something. Now that I'm trying, I find it's harder to ask properly than I thought.

My CSV files look like:
IP,Domain,ServerName 10.160.0.8,0, 10.160.0.9,0, 10.160.0.10,EURORSCG,ERWWDC1 10.160.0.11,EURORSCG,ERWWSQLWEB 10.160.0.12,EURORSCG,ERWWSEARCH 10.160.0.13,EURORSCG,ERWWNAB 10.160.0.14,EURORSCG,ERWWCOMMUNITIES
and
IP,DaysUptime,OS,RAM,OSSP,InstallDate,CPUSpeed,CPUCount,CPUType 10.160.0.10,19,Microsoft_Windows_2000_Server_Domain_Controller,1024,4, +12_2_2003,995,1,Intel_Pentium_III 10.160.0.11,266,Microsoft_Windows_2000_Server,2048,3,11_21_2003,3000,4 +,Intel_Xeon 10.160.0.12,21,Microsoft_Windows_2000_Server,1024,3,11_24_2003,1000,1, +Intel_Pentium_III 10.160.0.13,25,Microsoft_Windows_2000_Server,1024,3,11_20_2003,1000,1, +Intel_Pentium_III 10.160.0.14,3,Microsoft_Windows_2000_Server,1024,4,8_28_2002,1000,1,In +tel_Pentium_III 10.160.0.15,25,Microsoft_Windows_2000_Server,1024,4,5_23_2003,995,2,In +tel_Pentium_III

The files get inputted as hash arrays, %hosts and %sysinfo. I'd like to combined both into %combined, using the IP column as a key. I'd like it to look like:
IP,Domain,ServerName,DaysUptime,OS,RAM,OSSP,InstallDate,CPUSpeed,CPUCo +unt,CPUType 10.160.0.8,0, 10.160.0.9,0, 10.160.0.10,EURORSCG,ERWWDC1,19,Microsoft_Windows_2000_Server_Domain_C +ontroller,1024,4,12_2_2003,995,1,Intel_Pentium_III 10.160.0.11,EURORSCG,ERWWSQLWEB,266,Microsoft_Windows_2000_Server,2048 +,3,11_21_2003,3000,4,Intel_Xeon


In reply to Re^2: Process and combine two CSV files into one by DrAxeman
in thread Process and combine two CSV files into one by DrAxeman

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found