in reply to Need to save a single line from delete on some special condition
It may be worth investing a few days to write a script to parse any file in this format if it is a standard and you are going to work on it for some time. The product should be Perl nested hashtables to represent entities in your file, for example:
$lib1 = { 'pins' => { 'HIZIBI' => { 'timing' => { ...
Then you simply navigate to the pin you want and change whatever attributes you like. Finally, write the opposite of the parser, the dumpers so to speak and use it to save the file to disk in any file format you wish. If you want to go the extra mile, then create classes to represent each entity type in your files. If you are not acquainted with Perl classes, they are similar to hashes but with their own functions/methods/subs. You can even delegate the parsing/saving logic to each class.
Of course the parsing issue will still need to be dealt with but it's trivial once you forget about reading the entities and finding that specific attribute. The suggestion by clueless newbie can be of help in parsing the file: Re: Need to save a single line from delete on some special condition
If you want to go this direction just show some code and I can be of assistance.
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need to save a single line from delete on some special condition
by anirbanphys (Beadle) on Mar 27, 2019 at 11:54 UTC |