Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Deleting a block of text with sed
Name: rojanu Date: July 24, 2008 at 00:23:29 Pacific OS: Windows XP SP2 CPU/Ram: intel p4 1024 Mb ram
Comment:
Hi everyone,
I have a text with blocks similar following [FILE] <tu origin="tbx" tuid="32316" vuid="32316" filename="/some/path/to/a/file" SwKey="SomeStringIncluding_-:&$" xml:space="preserve" Inst="1" filetype=".txt"> <tuv xml:lang="EN-US"> <seg>Hide Process &Tool Tips</seg> </tuv> <tuv xml:lang="DE-DE"> <seg>&QuickInfo ausblenden</seg> </tuv> </tu> [/FILE] and I would like to remove blocks with text matching e.g. "SomeStringIncluding_-:&$" and keep rest of the file
I have found another post and tried to adapt the code to my file but as there is no explanation to the code I am struggling, here is the sed script I am using [SED_CODE] s/>/\>/g s/</\</g /^\s*$/d /^\s*\<\/tu\>/G /./{H;;} x;/SomeStringIncluding_-:\&\$/d; s/\>/>/g s/\</</g /^$/d [/SED_CODE]
I will be glad if you have time to explain the code as well, so next time I can stand on my own feet
Summary: Is there a way through batch scripting to capture/filter specific blocks of text (four lines each) from a text file when the text I am looking for is interspersed throughout the document? SysInternals...
Summary: Does anyone know how to delete the first line of text from a text file using a batch file (or a simple way from the command line)? Thanks, Cory ...
Summary: Hi, I'm looking for a simple batch file which will edit - delete a part of text a file, lets say arhiv.dat. With a command %date& > arhive.dat I get a file with system date, with a writen name of the...