Jarek has asked for the wisdom of the Perl Monks concerning the following question:
etc. That's the file construction. Now I need to look for the string which is always in front of "{" and depends on the action I need to for example cut whole block so from start to end, modify for example line 4, or replace line 2 to something. The problem is I know how to find it in the text file but the problem is how to do something like "find this and since that delete next 4 lines and save the file". Thank you for your help. Regards, Jarekline something starts here { contains line 1 contains line 2 contains line 3 contains line 4 ends here } next block of something starts here { contains line 1 contains line 2 contains line 3 contains line 4 ends here }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing, cutting, deleting lines in the file
by toolic (Bishop) on Nov 23, 2009 at 17:06 UTC | |
|
Re: Replacing, cutting, deleting lines in the file
by almut (Canon) on Nov 23, 2009 at 17:14 UTC | |
|
Re: Replacing, cutting, deleting lines in the file
by JavaFan (Canon) on Nov 23, 2009 at 17:08 UTC | |
|
Re: Replacing, cutting, deleting lines in the file
by gulden (Monk) on Nov 23, 2009 at 19:27 UTC | |
by Jarek (Novice) on Nov 24, 2009 at 14:38 UTC | |
by gulden (Monk) on Nov 24, 2009 at 18:42 UTC | |
by Jarek (Novice) on Nov 25, 2009 at 09:08 UTC |