Anybody have any ideas/suggestion how to read this files (sample files contents as below):
My original option are:(Filename: test.txt) Name : >Mick< [Mick] IC : '91919191929' [9191919129] PC : 123 [123] Number : >1960132400000< [1960132400000] Location : >000e 0036< [000e 0036] extension : >< Capability : >"CARES< ["CARES] Info : >6005494c523142< [6005494c523142] Name : >Nick< [Nick] IC : '1235467000' [1235467000] PC : 124 [124] Number : >1960192500000< [1960192500000] Location : >000f 0034< [000f 0034] extension : >< Capability : >< Info : >< Name : >Nick< [Nick] IC : '1235467000' [1235467000] PC : 124 [124] Number : >< [00] Location : >000f 0034< [000f 0034] extension : >< Capability : >.< Info : ><
Then, I've tried another method and the result still same. My second method are:
0. read files content
1. Change all the itesm (><|>\.<) to >TEST<
2. delete all the items likes ('|"|<|>);
3. split by line (split(/\n/));
4. Get $1 and $2 and insert into asociated array;
Ex: $1 ==> Capability: $2 ==> 124
5. Then, If the Capability or Info =~ /TEST/ then print.
6. Print back all the items without ('|"|<|>) and ignore all items in [.......].
Hopefully, somebody can help me....
Otherwise, My original script can be review in [id://272622[ or How to read/replace null value/parameters.
Thank you,
bh_perl
In reply to Can't read files content by bh_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |