in reply to Can anyone pls tel me how to cleanup this in Perl.
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can anyone pls tell me how to cleanup this in Perl.
by Anonymous Monk on Mar 19, 2013 at 06:07 UTC | |
by Athanasius (Archbishop) on Mar 19, 2013 at 06:14 UTC | |
by Anonymous Monk on Mar 19, 2013 at 06:41 UTC |