pindar has asked for the wisdom of the Perl Monks concerning the following question:
and this should become(LABEL O 50) (KRN O 200 R -0.05) ...etc
So I have this(LABEL O 50) (LIG O 50 O 2) (KRN O 200 R -0.05) ...etc
The problem is: not all the LABEL O XXX lines are already in the original file. Sometimes, I will have LIG instructions for a LABEL that does not exist yet. I know, e.g., that the instructions for the as yet nonexisting LABEL O 61 etc... must be placed between existing LABEL O 60 and LABEL O 62, but how can I instruct perl to include these instructions at the right address? Thanks so much for your help!!$_ =~ s/\(LABEL O 50\)/\(LABEL O 50\)\n \(LIG O 50 O 200\)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: adding lines at specific addresses
by sgifford (Prior) on Oct 10, 2005 at 16:06 UTC | |
|
Re: adding lines at specific addresses
by Zaxo (Archbishop) on Oct 10, 2005 at 17:40 UTC | |
|
Re: adding lines at specific addresses
by Skeeve (Parson) on Oct 10, 2005 at 16:06 UTC | |
by pindar (Initiate) on Oct 10, 2005 at 17:35 UTC | |
by graff (Chancellor) on Oct 10, 2005 at 22:42 UTC | |
by pindar (Initiate) on Oct 11, 2005 at 10:47 UTC | |
by graff (Chancellor) on Oct 11, 2005 at 12:37 UTC | |
|