04-03-2013
The description seems pretty vague. How about a sample input file, with code tags, and the expected output?
10 More Discussions You Might Find Interesting
1. AIX
By more, vi, cat etc commands special characters (few control characters) are not identified.
Is there any way to find out those?
Thanks
Sumit (3 Replies)
Discussion started by: sumitc
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am getting problem in parsing special characters(Like &, > or <) in XML. I need to encode my C program and send in report format to another interface which is in XML format.
I do not know how to encode these special characters in C program before sending to XML format. Please help !! (1 Reply)
Discussion started by: ronix007
1 Replies
3. UNIX for Dummies Questions & Answers
Can I get some help on this please, I have looked at the many post with similar questions and have tried the solutions and they are not working for my scenario which is:
I have a text file (myfile) that contains
b_log=$g_log/FILENAME.log
echo "Begin processing file FILENAME " >> $b_log
... (4 Replies)
Discussion started by: CAGIRL
4 Replies
4. UNIX for Dummies Questions & Answers
HI All
I need a shell script ehich removes all special characters from file and converts the file to UTF-* format
Specail characters to be removed must be configurable.
strIllegal = @"?/><,:;""'{|\\+=-)(*&^%$#@!~`";
Please help me in getting this script as my scripting skilla are... (2 Replies)
Discussion started by: sujithchandra
2 Replies
5. UNIX for Dummies Questions & Answers
Well, I've searched the forum, but couldn't find an option, that would help me. I'm really a dummie in unix, so here it goes.
I've got like 50k files in a single catalogue. One of them contains a string:
Including the box/square brackets. I tried to find it manually, and use some search... (2 Replies)
Discussion started by: kalik
2 Replies
6. Shell Programming and Scripting
Hi,
I am creating a script to do a find and replace single/multiple lines in a file with any number of lines.
I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE
print $FIND gives
Hi How r $u
Rahul()
Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I'm trying to find all DISTINCT words having _mr in the line and ENCLOSED in '/'.
For eg below is the text in a file..
/database/new_mr254/1
/database/rawdb/views/new_mr254/1
/database/project/rawdb/tables/new_mr232/1
/database/project/rawdb/views/new_mr253/1... (5 Replies)
Discussion started by: northwest
5 Replies
8. Shell Programming and Scripting
I have flat file which has data like this
glid¿as_liste¿025175456
How can I print these lines into new file? (4 Replies)
Discussion started by: sol_nov
4 Replies
9. AIX
Hi
I read xml files through mq and placed them on unix by using datastage as tool.
I can see some special characters infront of declaration part for every xml file i have produced.
below is the sample snippet when i opened the file by suing vi editor
^Z^E|^A^Z^Z<?xml version="1.0"... (1 Reply)
Discussion started by: dsdev_123
1 Replies
10. How to Post in the The UNIX and Linux Forums
Hi All,
I am trying to replace the values inside <password> tag in an xml file but it doesn't replace certain passwords:
For eg:
Server/home/sperinc>cat TextXML.txt
<appIds>
<entry name="AccountXref">
<type id="ldap">
<realm>nam</realm>
... (7 Replies)
Discussion started by: saroopkris85
7 Replies
LEARN ABOUT DEBIAN
xml_pp
XML_PP(1p) User Contributed Perl Documentation XML_PP(1p)
NAME
xml_pp - xml pretty-printer
SYNOPSYS
xml_pp [options] [<files>]
DESCRIPTION
XML pretty printer using XML::Twig
OPTIONS
-i[<extension>]
edits the file(s) in place, if an extension is provided (no space between "-i" and the extension) then the original file is backed-up
with that extension
The rules for the extension are the same as Perl's (see perldoc perlrun): if the extension includes no "*" then it is appended to the
original file name, If the extension does contain one or more "*" characters, then each "*" is replaced with the current filename.
-s <style>
the style to use for pretty printing: none, nsgmls, nice, indented, record, or record_c (see XML::Twig docs for the exact description
of those styles), 'indented' by default
-p <tag(s)>
preserves white spaces in tags. You can use several "-p" options or quote the tags if you need more than one
-e <encoding>
use XML::Twig output_encoding (based on Text::Iconv or Unicode::Map8 and Unicode::String) to set the output encoding. By default the
original encoding is preserved.
If this option is used the XML declaration is updated (and created if there was none).
Make sure that the encoding is supported by the parser you use if you want to be able to process the pretty_printed file (XML::Parser
does not support 'latin1' for example, you have to use 'iso-8859-1')
-l loads the documents in memory instead of outputing them as they are being parsed.
This prevents a bug (see BUGS) but uses more memory
-f <file>
read the list of files to process from <file>, one per line
-v verbose (list the current file being processed)
-- stop argument processing (to process files that start with -)
-h display help
EXAMPLES
xml_pp foo.xml > foo_pp.xml # pretty print foo.xml
xml_pp < foo.xml > foo_pp.xml # pretty print from standard input
xml_pp -v -i.bak *.xml # pretty print .xml files, with backups
xml_pp -v -i'orig_*' *.xml # backups are named orig_<filename>
xml_pp -i -p pre foo.xhtml # preserve spaces in pre tags
xml_pp -i.bak -p 'pre code' foo.xml # preserve spaces in pre and code tags
xml_pp -i.bak -p pre -p code foo.xml # same
xml_pp -i -s record mydb_export.xml # pretty print using the record style
xml_pp -e utf8 -i foo.xml # output will be in utf8
xml_pp -e iso-8859-1 -i foo.xml # output will be in iso-8859-1
xml_pp -v -i.bak -f lof # pretty print in place files from lof
xml_pp -- -i.xml # pretty print the -i.xml file
xml_pp -l foo.xml # loads the entire file in memory
# before pretty printing it
xml_pp -h # display help
BUGS
Elements with mixed content that start with an embedded element get an extra
<elt><b>b</b>toto<b>bold</b></elt>
will be output as
<elt>
<b>b</b>toto<b>bold</b></elt>
Using the "-l" option solves this bug (but uses more memory)
TODO
update XML::Twig to use Encode with perl 5.8.0
AUTHOR
Michel Rodriguez <mirod@xmltwig.com>
perl v5.12.4 2011-05-18 XML_PP(1p)