where "a,"b",c" and "d,"e",f" are column headers. Columns are defined in the files as such:merge.pl file_1 a,b,c file_2 d,e,f
Specifically, what I want to do is: From file_1:#DFD ' ' #H Period Interface SrcRouter Subset MbitsCap Polls MbpsIn MbpsOut MbpsSum InMinUtil In5pUtil InAvgUtil In95pUtil InMaxUtil InUtilSD InMaxTS OutMinUtil Out5pUtil OutAvgUtil Out95pUtil OutMaxUtil OutUtilSD OutMaxTS EffMinUtil Eff5pUtil EffAvgUtil Eff95pUtil EffMaxUtil EffUtilSD EffMaxTS Class InPctDiscards InPctErrors InPctDiscErr InPctDiscErr95Q OutPctDiscards OutPctErrors OutPctDiscErr OutPctDiscErr95Q SecSysUpTime InWrapEvts InWrapCnts OutWrapEvts OutWrapCnts PctPollsGT80pUtil PctPollsGT1pDiscErr Flags KppsIn KppsOut IfDescr IfIndex #F %-17s %-35s %-15s %-6s %9.5f %7d %14.3f %14.3f %14.3f %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %7.3f %7.3f %7.3f %7.3f %7.3f %9.5f %14s %3s %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f %10d %7d %7d %7d %7d %7.3f %7.3f %-10s %14.3f %14.3f %-30s %-10s
From file_2:create a hash whose keys are any of the headers specified on the command line. Each key value is a reference to an array containing the data from each column.
NOTE: There will ALWAYS be matching data between both files, but NOT necessarily under the same header label! For example:create another hash whose keys are any of the headers specified on the command line. Each key value is a reference to an array containing the data from each column.
After assembling these data structures, I want to merge them, in structured format, and print the resulting merged file to <STDOUT>. I'm not sure if this is any clearer, but please let me know if it's not.the column "SrcRtr" from file_1 contains the exact same data as the column "DstDev" in file_2
In reply to Re: @ARGV Manipulation
by Limo
in thread @ARGV Manipulation
by Limo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |