[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] [olug] need some quick help with sed
On Dec 18, 2009, at 9:09 AM, Obi-Wan wrote:
> This will remove all the XML tags from a line:
>
> postID=`cat ./data.xml | sed -e 's/<[^>]*>//g'`
I doubt we wants to shove the whole file (minus XML tags) into postID.
But, in case he does, here's an equivalent Perl command (strip all tags):
perl -pe 's/<.*?>//g' data.xml
(This solution is probably naive. CDATA tags, multi-line tags, etc.?)
j
Omaha Perl Mongers: http://omaha.pm.org