Sponsored Content
Top Forums Shell Programming and Scripting Using SED/AWK to extract xml at end of file Post 302466433 by vgersh99 on Tuesday 26th of October 2010 11:03:59 AM
Old 10-26-2010
Code:
sed -n '/Sending XML/,/Message sending ended/p' ${infile} > ${outfile}

This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed or awk to extract data from Xml file

Hi, I want to get data from Xml file by using sed or awk command. I want to get the following result : mon titre 1;Createur1;Dossier1 mon titre 1;Createur1;Dossier1 and save it in cvs file (fichier.cvs). FROM this Xml file (test.xml): <playlist version="1"> <trackList> <track>... (1 Reply)
Discussion started by: yeclota
1 Replies

2. UNIX for Dummies Questions & Answers

Using sed to extract a substring at end of line

This is the line that I am using: sed 's/^*\({3}*$\)/\1 /' <test.txt >results.txt and suppose that test.txt contains the following lines: http://www.example.com/200904/AUS.txt http://www.example.com/200903/_RUS.txt http://www.example.com/200902/.FRA.txt What I expected to see in results.txt... (6 Replies)
Discussion started by: figaro
6 Replies

3. Shell Programming and Scripting

SED extract XML value

I have the following string: <min-pool-size>2</min-pool-size> When I pipe the string into the following code I am expcting for it to return just the value "2", but its just reurning the whole string. Why?? sed -n '/<min-pool-size>/,/<\/min-pool-size>/p' Outputting:... (13 Replies)
Discussion started by: ArterialTool
13 Replies

4. UNIX for Dummies Questions & Answers

Extract a specific number from an XML file based on the start and end tags

Hello People, I have the following contents in an XML file ........... ........... .......... ........... <Details = "Sample Details"> <Name>Bob</Name> <Age>34</Age> <Address>CA</Address> <ContactNumber>1234</ContactNumber> </Details> ........... ............. .............. (4 Replies)
Discussion started by: sushant172
4 Replies

5. Shell Programming and Scripting

reformatting xml file, sed or awk I think (possibly perl)

I have some xml files that cannot be read using a standard parser, or I am using the wrong parser. The issues seems to be spaces in some of the tags. Here is a sample,<UgUn 2 > <Un> -0.426753 </Un> </UgUn>The parser isn't able to find the number 2, so that information is lost, etc. It seems... (16 Replies)
Discussion started by: LMHmedchem
16 Replies

6. Shell Programming and Scripting

sed extract from xml

I have an xml file that generally looks like this: "<row><dnorpattern>02788920</dnorpattern><description/></row><row><dnorpattern>\+ 44146322XXXX</dnorpattern><description/></row><row><dnorpattern>40XXX</dnorpattern><description/></row><row><dnorpattern>11</dn... (4 Replies)
Discussion started by: garboon
4 Replies

7. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

8. Shell Programming and Scripting

Use grep sed or awk to extract string from log file and put into CSV

I'd like to copy strings from a log file and put them into a CSV. The strings could be on different line numbers, depending on size of log. Example Log File: File = foo.bat Date = 11/11/11 User = Foo Bar Size = 1024 ... CSV should look like: "foo.bat","11/11/11","Foo Bar","1024" (7 Replies)
Discussion started by: chipperuga
7 Replies

9. Shell Programming and Scripting

sed - extract text from xml file

hi, please help, i have an xml file, e.g: ... <tag> test text asdas="${abc}" xvxvbs:asdas${222}sdad asasa="${aa_bb_22}" </tag> ... i want to extract all "${...}", e.g: ${abc} ${222} ${aa_bb_22} thank you. (2 Replies)
Discussion started by: gioni
2 Replies

10. Shell Programming and Scripting

Extract a particular xml only from an xml jar file

Hi..need help on how to extract a particular xml file only from an xml jar file... thanks! (2 Replies)
Discussion started by: qwerty000
2 Replies
SAR2PCP(1)						       Performance Co-Pilot							SAR2PCP(1)

NAME
sar2pcp - Import sar data and create a PCP archive SYNOPSIS
sar2pcp infile outfile DESCRIPTION
sar2pcp is intended to read a binary System Activity Reporting (sar) data file as created by sadc(1) (infile) and translate this into a Performance Co-Pilot (PCP) archive with the basename outfile. However, if infile has the suffix ".xml", then it will be considered already in XML format and sar2pcp will operate directly on it. The resultant PCP achive may be used with all the PCP client tools to graph subsets of the data using pmchart(1), perform data reduction and reporting, filter with the PCP inference engine pmie(1), etc. A series of physical files will be created with the prefix outfile. These are outfile.0 (the performance data), outfile.meta (the metadata that describes the performance data) and outfile.index (a temporal index to improve efficiency of replay operations for the archive). If any of these files exists already, then sar2pcp will not overwrite them and will exit with an error message of the form __pmLogNewFile: "blah.0" already exists, not over-written sar2pcp is a Perl script that uses the PCP::LogImport Perl wrapper around the PCP libpcp_import library, and as such could be used as an example to develop new tools to import other types of performance data and create PCP archives. A Python wrapper module is also available. CAVEATS
When not using the XML input option, sar2pcp requires infile to have been created by a version of sadc(1) from <http://sebastien.godard.pagesperso-orange.fr/> which includes the sadf(1) utility to translate infile into an XML stream (any since version 6); sar2pcp will automatically run sadf(1) and translate the resultant XML into a PCP archive. When using binary sadc files it is important to ensure the installed sadf is compatible with the version of sadc that originally generated the binary files. Simply assuming a newer installed version will work is unfortunately far too optimistic, and nor should one assume that binary data from different platforms (e.g. different endianness) will work - these issues are due to limitations in sadc and sadf, and not in sar2pcp itself. Fortunately, the sadf message indicating that an incompatibility has been detected is consistent across versions, and is always prefixed Invalid system activity file Using an XML infile has the advantage that the installed version of sadf is completely bypassed. sar2pcp undertakes to transform any valid XML produced by any of the different variations of sadf into a valid PCP archive. Any version of PCP will be able to interpret the archive files produced by any version of sar2pcp, and you are also free to move the binary PCP archive between different platforms, different hardware, even different operating systems - it Just Works (TM). SEE ALSO
pmie(1), pmchart(1), pmlogger(1), pmlogextract(1), pmlogsummary(1), sadc(1), sadf(1), sar(1), Date::Parse(3pm), Date::Format(3pm), PCP::LogImport(3pm), XML::TokeParser(3pm) and LOGIMPORT(3). 3.8.10 Performance Co-Pilot SAR2PCP(1)
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy