hi
i want to generate standard file from log file. log file containts information about files which are copied to testing region. log files looks as follows
now there can be many entries for single file but with different versions but i want that only file with latest version should be present in new file.
i am using perl for this there are total 5 scripts to do final job 4 are ready i am stuck with this one to get unique components only
i have hash in which i store file name and its key is version no i check entry of file in hash if its there then i comaprare otherwise i add in hash but what i want is that other information on that is importatnt for same file ii may change also like version label so final file should be list of uniq files with all other information intact as shown in first file.
I'm not totally sure what you want to do. But to limit display of lines with identical filename to the highest version only, you can put the line into the hash and after filtering you will get what you want. Here is an example (5 lines into 4):
# display from subroutine stored indicates version stored in hash and read is one which need to be compared
# stored : HASH(0x4014f620) read : 1.7
# HASH(0x4014f620)0000000000000000000000000000 :1st sting
#00010007000000000000000000000000 :2nd sting
/Clients/NCB/Frontend/html/032001.htm 1.1 20071213 SPR 30417 /FEBase/html/032001.htm
/Clients/NCB/Frontend/xml/Transactions/060658.xml 1.2 20071213 SPR 30418 /FEBase/xml/Transactions/060658.xml
/Clients/NCB/BANCS-24/cob/CI0051.COB 1.35 20071213 SPR 30417 /BASE/src/CI0051.COB
/Clients/NCB/Core/htc/FlowComponents/CommissionFetch.htc 1.5 20071213 SPR 30251 /FEBase/htc/FlowComponents/CommissionFetch.htc
Can't use string ("CommissionFetch.htc") as a HASH ref while "strict refs" in use at test.pl line 56, <PROLOG> line 6.