11-08-2011
AWK to Parse XML messages
Of course it has been through MS Word, this is only a sample of the messages and secondly i have removed the date and the time.
So this have been edited on MS Word
Last edited by James_Owen; 11-08-2011 at 04:29 PM..
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I'm looking for an "easy" way to parse a xml file to a proper structure.
The xml looks like this
What shall I use? Does anybody has some example-code to share or some good links/book-references?
thx for any reply
-fe (5 Replies)
Discussion started by: bin-doph
5 Replies
2. Shell Programming and Scripting
I need to know the way. I have got parsing down some nodes. But I was unable to get the child node perfectly. If you have code please send it. It will be very useful for me. (0 Replies)
Discussion started by: girigopal
0 Replies
3. Shell Programming and Scripting
Hi , I need an Awk script to parse my log file .
2008-04-26 10:00:13,391 INFO Logger - <?xml version="1.0" encoding="UTF-8" standalone="no"?><2dm
tmsg... (0 Replies)
Discussion started by: amit1_x
0 Replies
4. Shell Programming and Scripting
I have an task definition listing xml file that contains a list of tasks such as
<TASKLIST
<TASK definition="Completion date" id="Taskname1" Some other
<CODE name="Code12"
<Parameter pname="Dog" input="5.6" units="feet" etc /Parameter>
<Parameter... (3 Replies)
Discussion started by: MissI
3 Replies
5. Shell Programming and Scripting
Hi All,
I have an xml file with the below format.
<a>111</a><b>222</b><c>333<c><d><e>123</e><f>234</f><d><e>456</e><f>789</f>
output needed is
111,222,333,123,234
111,222,333,456,789
nawk 'BEGIN{FS="<|>"}
{print a,b,c,e,f
a=""
... (7 Replies)
Discussion started by: natalie23
7 Replies
6. UNIX for Dummies Questions & Answers
Thanks in advance who can answer.
I have to make a small shell that after reading an XML file and extract the fields I create a text file with the same fields taken previously in tabular form.
I did this
parse.awk
----------------------
BEGIN {
FS=""
}
{
for(i=2; i<=NF; i+=2) {
... (1 Reply)
Discussion started by: mcarlo65
1 Replies
7. Shell Programming and Scripting
Hi,
I have to make an script according to these:
- I have couples of files like:
xxxxxxxxxxxxx.csv
xxxxxxxxxxxxx_desc.xml
- every xml file has diferent fields, but keeps this format:
........
<defaultName>2011-02-25T16:43:43.582Z</defaultName>
........... (2 Replies)
Discussion started by: Pluff
2 Replies
8. Shell Programming and Scripting
Well, that's what I'd do in bash :) Here's what I have so far:
import urllib2
from BeautifulSoup import BeautifulStoneSoup
xml = urllib2.urlopen('http://weatherlink.com/xml.php?user=blah&pass=blah')
soup = BeautifulStoneSoup(xml)
print soup.prettify()
but all it does is grab the html... (0 Replies)
Discussion started by: unclecameron
0 Replies
9. Shell Programming and Scripting
Hi Guy's
Can I please get some help with this code.
I have xml feed file which rapidly changing temporary file and I need to capture the content of this file as soon as data arrives.
Example of the data
Required data output
Time is current time.
This is awk code that I have so far... (4 Replies)
Discussion started by: James_Owen
4 Replies
10. Shell Programming and Scripting
I have an XML tag like this:
<property name="agent" value="/var/tmp/root/eclipse" />
Is there way using awk that i can get the value from the above tag. So the output should be:
/var/tmp/root/eclipse
Help will be appreciated.
Regards,
Adi (6 Replies)
Discussion started by: asirohi
6 Replies
PDB(4) PDB(4)
NAME
PDB - (Pilot Database) file format
SYNOPSIS
#define dmDBNameLength 32/* 31 chars + 1 null terminator */
struct pdb_header { /* 78 bytes total */
char name[ dmDBNameLength ];
Word attributes;
Word version;
DWord create_time;
DWord modify_time;
DWord backup_time;
DWord modificationNumber;
DWord appInfoID;
DWord sortInfoID;
char type[4];
char creator[4];
DWord id_seed;
DWord nextRecordList;
Word numRecords;
};
struct pdb_rec_header { /* 8 bytes total */
DWord offset;
struct {
int delete : 1;
int dirty : 1;
int busy : 1;
int secret : 1;
int category : 4;
} attributes;
char uniqueID[3];
}
DESCRIPTION
The PDB (Pilot Database) file format is used by all models of the Palm Pilot and IBM Workpad. The format consists of a header followed by
a set of record headers followed by the records themselves.
Word Sizes
In the SYNOPSIS above, the types ``Byte,'' ``Word,'' and ``DWord'' are used just as in the Pilot headers. The type ``Byte'' is 8 bits;
``Word'' is 16 bits; ``DWord'' is 32 bits. The latter two are in big-endian format.
CAVEATS
1. The C structures given in the SYNOPSIS above are illustrative and most likely will not work in actual C code since compilers align data
members on word boundaries.
2. The PDB file format presented here is not official and was written at the time when PDB file format was not public. It is possibly out-
dated. The official standard is available on the Palm web page. (SEE ALSO)
SEE ALSO
txt2pdbdoc(1), html2pdbtxt(1), pdbtxt2html(1), doc(4)
Palm Computing Inc. Palm File Format Specification, 2000.
http://www.palmos.com/dev/support/docs/fileformats/front.html
AUTHOR
Paul J. Lucas <pauljlucas@mac.com> Updated by Erik Schanze <eriks@debian.org>
txt2pdbdoc August 20, 2005 PDB(4)