bh_perl has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't read files content
by BrowserUk (Patriarch) on Jul 11, 2003 at 04:56 UTC | |
|
Re: Can't read files content
by JamesNC (Chaplain) on Jul 11, 2003 at 05:09 UTC | |
by bh_perl (Monk) on Jul 16, 2003 at 02:31 UTC | |
|
Re: Can't read files content
by artist (Parson) on Jul 11, 2003 at 04:24 UTC | |
|
Re: Can't read files content
by mildside (Friar) on Jul 11, 2003 at 05:00 UTC |