Firstly i do not require alot of help.. i am right at the end of finishing my scipt but cannot find a solution to the last part.
What i need to do is, prompt the user for a file to work with, which i have done.
promt the user for an output file - which is done.
The file, is .txt and is massive, i only need the last 200 lines or so which is XML... I know i can use SED to specify what line numbers to extract to the output file, but not all documents that use this script will require the last 200, it could be the midlle 50.
Which leads me on to my problem, using SED or AWK i would like to extract all the xml after 'Sending XML' which is consistant accross all documents, up until the words ' Message sending ended.'
I have been reading various articles/forums which have helped and has lead me to providing my current example. Although, using line numbers is not feasible, they will differ accross the documents, whereas the words above are always present.
I really hope someone can help as i have spent far too much time on this!
Thanks!
H
Last edited by hugh86; 10-26-2010 at 12:00 PM..
Reason: english
I cannot thank you enough.. i have posted on so many forums and no one ever gets back to me! I will be using this more often!
I now have another issue, The XML i have been left with has line breaks, see below:
As you can see, the line break has effected this tag half is on the line below and this XML cannot be used like that. I would like for it to remove the linespaces at the start of the line, looking like : </object>
Thank you so much for your help!!
Last edited by hugh86; 10-26-2010 at 12:17 PM..
Reason: code tags wrong
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)
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)
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)
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)
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)
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)
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)
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)
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)