Thanks for your reply ... but if have to get it from a xml file then how can we get that
means if this tag is there in a xml file and we have to find the length of value/data which is in between tags ....then how can we get the length for the value/data which is between tags from a xml file
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
hello!
I have a file with fixed record length...
format:
123445asdfg 4343777 sfgg
I wanna convert it to
123445,asdfg ,4343,777 ,sfgg
is there any way to do it?
sed/grep/awk??
at the moment I use sed -e 's_ \(\)_,\1_g'
but it works only if there are spaces between... (16 Replies)
Hi, all.
I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file:
10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783
19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657
And this is the expected... (2 Replies)
Hi
I need to be search a file of fixed length records and when I hit a particular record that match a search string, substitute a known position field
In the example file below
FHEAD000000000120090806143011
THEAD0000000002Y0000000012 P00000000000000001234
TTAIL0000000003... (0 Replies)
Hi Guys,
I wanted to print the length of each record and the record itself.
I tried the following awk ...
awk 'a=length(); {print $a,$0}' file1
But it is giving me the records instead of length.
and also, it giving me each record twice. Means the value of a is not the length of the... (0 Replies)
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Hi,
I have a file which have set of rows and has to create separate files based on the id.
Eg:
001_AHaris020
001_ATony030
002_AChris090
002_ASmit060
003_AJhon001
Output: I want three files like 001_A.txt, 002_A.txt and 003_A.txt.
001_A.txt should have
... (4 Replies)
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
I am new to awk and writing a script using awk. I have file containing fixed length records, I wish to extract 2 substring(each substring is padded with zeros on left e.g 000000003623) and add each substring respectively for every record in the file to get total sum of respective substring for all... (5 Replies)
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
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)