Hi all,
I have a problem with qwk command.
i have to check process status and for that i am using command
prstat -mvL 1 1
and it gives me the entire output
but when i use this command with awk like this:
prstat -mvL 1 1 | awk -F" " '{print $1,$15}'
to get first and 15th arguments.
... (3 Replies)
Hi All,
I am hoping someone can help me with some scripting I need to complete using AWK.
I'm trying to process multiple fixed files to generate one concatenated fixed file in a standard format.
The Input file is:-
aaaa bbbbb ccccc 1 xxxx aaa bbb
aaaa bbbbb ccccc 2 abcd aaa CCC... (9 Replies)
Hi Gurus,
I need a suggestion, please help. I have a input file as below :
abc.txt :
*
xxxx: 00000
xxxxx: 00000
xxxx: RANDOM
xxx: RANDOM
**************************xxxxxxx***
* abc
******************************
abc:
abc: ... (3 Replies)
Hi...Does anyone know how to input huge file about 25 GB to awk
if single file then this works
awk '{print}' <hugefile
suppose if have to use something like this
awk FNR==NR{x=$0;next}{print $0,x}' hugefile1 hugefile2
then how to redirect ? and is there any provision to assign memory... (12 Replies)
Hi All,
Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab.
Cat my.awk
#!/bin/awk -f
function test(var){
some code}
{
}
END
{
print"test code"
} (5 Replies)
I have one input file ABC.txt and one output DEF.txt. After the ABC is processed and created output, I want to rename ABC.txt to ABC.orig and DEF to ABC.txt. Currently when I am doing this, it does not process the input file as it cannot read and write to the same file. How can I achieve this?
... (12 Replies)
The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format:
input
chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18
chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix.
I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice.
Files:... (3 Replies)
cat filename| awk '{ $1=""; print $0}'
in my file there are few lines that has more than 3000 characters per line and as soon as I run the above command it cores, strings core reveals that the awk is failing because input string too long, limit. can i get some help from the experts to find... (8 Replies)
Discussion started by: knijjar
8 Replies
LEARN ABOUT DEBIAN
xml::libxml::lazybuilder
XML::LibXML::LazyBuilder(3pm) User Contributed Perl Documentation XML::LibXML::LazyBuilder(3pm)NAME
XML::LibXML::LazyBuilder - easy and lazy way to create XML document for XML::LibXML
SYNOPSIS
use XML::LibXML::LazyBuilder;
{
package XML::LibXML::LazyBuilder;
$d = DOM (E A => {at1 => "val1", at2 => "val2"},
((E B => {}, ((E "C"),
(E D => {}, "Content of D"))),
(E E => {}, ((E F => {}, "Content of F"),
(E "G")))));
}
DESCRIPTION
You can describe XML documents like simple function call instead of using createElement, appendChild, etc...
FUNCTIONS
E
E "tagname", \%attr, @children
Creats CODEREF that generates "XML::LibXML::Element" which tag name is given by first argument. Rest arguments are list of text
content or child element created by "E" (so you can nest "E").
Since the output of this function is CODEREF, the creation of actual "XML::LibXML::Element" object will be delayed until "DOM" function
is called.
DOM
DOM &docroot, $var, $enc
Generates "XML::LibXML::Document" object actually. First argument is a CODEREF created by "E" function. $var is version number of XML
docuemnt, "1.0" by default. $enc is encoding, "utf-8" by default.
EXPORT
None by default.
:all
Exports "E" and "DOM".
EXAMPLES
I recommend to use "package" statement in a small scope so that you can use short function name and avoid to pollute global name space.
my $d;
{
package XML::LibXML::LazyBuilder;
$d = DOM (E A => {at1 => "val1", at2 => "val2"},
((E B => {}, ((E "C"),
(E D => {}, "Content of D"))),
(E E => {}, ((E F => {}, "Content of F"),
(E "G")))));
}
Then, "$d->toString" will generate XML like this:
<?xml version="1.0" encoding="utf-8"?>
<A at1="val1" at2="val2"><B><C/><D>Content of D</D></B><E><F>Content of F</F><G/></E></A>
SEE ALSO
XML::LibXML
AUTHOR
Toru Hisai, <toru@torus.jp>
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Toru Hisai
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.
perl v5.12.3 2008-11-10 XML::LibXML::LazyBuilder(3pm)