Problems? Is your data what you think it is? | |
PerlMonks |
compare data between two files using Perlby steveb94553 (Initiate) |
on Jun 16, 2008 at 17:14 UTC ( [id://692315]=perlquestion: print w/replies, xml ) | Need Help?? |
steveb94553 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to compare some data between two files. First I open a file (brd_sym_pn.txt) with data extracted from a database and pull the reference designator($RefDes), part number ($Pnum) and package type ($Pkg_Type). Then I open another file (sym_text_latest.txt) and extract/assign the part number ($LogPnum) and package type ($LogPkg_Type). I am trying to compare the $Pnum and $Pkg_Type for each $ RefDes between brd_sym_pn.txt and sym_text_latest.txt, reporting back if the $Pnum/ $pkg_Type does/does notmatches the $LogPnum/$LogPkg_Type assignment in sym_text_latest.txt. It seems that I have too many loops and should be cycling through each reference designator or line of brd_sym_pn.txt. I have tried to make this work for about 3-4 days and desperately need some help. brd_sym_pn.txt Begin J2 12-0259-01 HDR-1X28-100-FLK-VT P1 12-0258-01 HDR-2X12-118-VT end J1 12-0259-01 HDR-1X2-100-FLK-VT P2 12-0257-01 HDR-2X7-118-VT MTG4 MTG_250_H115 MTG_250_H115 MTG5 MTG_250_H115 MTG_250_H115 P3 12-0255-01 RECPT-2X7-118-VT MTG3 MTG_250_H115 MTG_250_H115 P4 12-0255-01 RECPT-2X7-118-VT MTG2 MTG_250_H115 MTG_250_H115 MTG1 MTG_250_H115 MTG_250_H115 END sym_text_latest.txt Begin Part number type mfg. P/n description pkg_type height mm > mil notes 12-0255-01 CON 44769-1403 "CONN,REC,14 PIN,THOLE,0.118 SPACE,VERT,RECPT-2X7-118-VT" RECPT-2X7-118-VT 13.6 535.432 new part number release 12-0256-01 CON 44769-1203 "CONN,REC,12 PIN,THOLE,0.118 SPACE,VERT,RECPT-2X6-118-VT" RECPT-2X6-118-VT 13.6 535.432 new part number release 12-0257-01 CON 43045-1414 "CONN,HDR,14 PIN,THOLE,0.118 SPACE,VERT,HDR-2X7-118-VT" HDR-2X7-118-VT 9.9 389.763 new part number release 12-0258-01 CON 43045-1214 "CONN,HDR,12 PIN,THOLE,0.118 SPACE,VERT,HDR-2X6-118-VT" HDR-2X6-118-VT 9.9 389.763 new part number release 12-0259-01 CON 22-29-2021 "CONN,HDR,2 PIN,THOLE,0.100 SPACE,VERT,HDR-1X2-100-FLK-VT" HDR-1X2-100-FLK-VT 11.7 460.629 new part number release END
Back to
Seekers of Perl Wisdom
|
|