02-27-2012
Probably but you'll need to be more specific. XML can hold nested structures that make no sense to try and convert to CSV, and even given a simple structure, arbitrary XML just isn't trivial to convert to a flatfile.
So show the exact XML you have and the exact output you want please.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi people!,
I need extract from the file (test-file.txt) the values between
<context> and </context> tag's , the total are 7 lines,but i can only get 5 or 2 lines!!:confused:
Please look my code:
#awk '/context/{flag=1} /\/context/{flag=0} !/context/{ if (flag==1) p
rint $0; }'... (3 Replies)
Discussion started by: ricgamch
3 Replies
2. Shell Programming and Scripting
Hi,
I have a filename.csv in which there are 3 colums, ie:
Name ; prefixnumber ; number
root ; 020 ; 1234567
user1,2,3 ; 070 ; 7654321
What I want is to merge colum 2 and 3 that it becomes 0201234567 or even better +31201234567 so the country number is used and drop the leading 0.... (9 Replies)
Discussion started by: necron
9 Replies
3. Shell Programming and Scripting
Hi,
I have an xml file and I want to convert it with awk in to a csv file
Test.xml
<Worksheet ss:Name="Map1">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1"
x:FullRows="1" ss:DefaultColumnWidth="60">
<Row>
<Cell><Data... (6 Replies)
Discussion started by: research3
6 Replies
4. Shell Programming and Scripting
Hello,
I have two text files (txt1 and txt2). txt1 contains many lines with a single number in each line. txt2 (xml format) contains information about the numbers given in txt1. I need to insert one line in txt2 within the scope of each number taken from txt1.
Sample problem:
txt1:
12
23... (1 Reply)
Discussion started by: shekhar2010us
1 Replies
5. Shell Programming and Scripting
Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this!
This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Discussion started by: juampal
9 Replies
6. Shell Programming and Scripting
I have a XML in which <Amt Ccy="EUR">3.1</Amt> tag repeats. This is under another tag <Main>. I need to sum all the values of <Amt Ccy=""> (Ccy may vary) coming under <Main> using awk and or sed command.
can some help?
Sample looks like below
<root>
<Main>
... (6 Replies)
Discussion started by: bk_12345
6 Replies
7. Shell Programming and Scripting
below is the output xml string from some other command and i will be parsing it using awk
cat /tmp/alerts.xml
<Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies
8. Shell Programming and Scripting
Hi All,
I want to modify(changing the status from "on" to "off" status of Stage-element value from the below xml file using sed or awk:
File Name: global.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<widget>
<name>HTTP-POOL</name>
<attributes>
... (5 Replies)
Discussion started by: wamqemail2
5 Replies
9. Shell Programming and Scripting
Hello,
I am working on a part of code where I need a awk or shell script to convert the given XML file to CSV or TXT file.
There are multiple xml files and of different structure, so a single script is required for converting data.
I did find a lot of solutions in the forum but... (16 Replies)
Discussion started by: Rashmitha
16 Replies
10. Shell Programming and Scripting
I have the following csv file at the path; now using sed command. what is this exactly doing.
sed -i 's//,/g' /FTP/LAB_RESULT_CM.csv
Thank you very much for the helpful info. (2 Replies)
Discussion started by: cplusplus1
2 Replies