NetWallah’s advice is correct, and if you follow it you will save yourself a lot of time and difficulty in the long run. But — to show off Perl’s text-munging power — the following quick-and-dirty script (OK, hack) will produce output close to what you’re seeking (for this data):
#! perl use strict; use warnings; if (my ($field) = grep { /^!!./ } split /\|/, do { local $/; <DATA> }) { my @lines = $field =~ m{ minor-latin%22%3E (.*?) %3C }gx; for (@lines) { s{ \\x92 }{'}gx; s{ %5C } {}gx; s{ %27 }{'}gx; s{ %26amp; }{&}gx; } print join("\n", @lines); } __DATA__ <insert the data here>
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Can anyone pls tell me how to cleanup this in Perl.
by Athanasius
in thread Can anyone pls tel me how to cleanup this in Perl.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |