UNIX shell script required to read two columns from xml


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers UNIX shell script required to read two columns from xml
# 1  
Old 03-09-2019
Please, please, please - with your next problem, apply utmost care from the beginning, and start with the ENTIRE picture, provide sufficient info and representative data samples, and DON'T change goals!


You can pipe your above result through another awk script for creating the SQL insert statement, but irrespective of the TOINSTANCETYPE as it is not known in the result:
Code:
awk -f ... |
awk '{IX[$1]; VAL[$1,NR%2] = $2} END {for (x in IX) print "INSERT INTO", x, "values (\"" VAL[x,1] "\" , \"" VAL[x,0] "\");"}'
INSERT INTO EPIC values ("DID" , "PROJECT_NAME");
INSERT INTO SQ_EPIC values ("DID" , "PROJECT_NAME");

You could even try to implement the "insert" creation into the first awk script; this is left as an exercise to the reader.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read xml tags and then remove the tag using shell script

<Start> <Header> This is header section </Header> <Body> <Body_start> This is body section <a> <b> <c> <st>111</st> </c> <d> <st>blank</st> </d> </b> </a> </Body_start> <Body_section> This is body section (3 Replies)
Discussion started by: RJG
3 Replies

2. Shell Programming and Scripting

UNIX Shell script to work with .xml file

Hi Team, Could you please help me on below query: I want to retrieve XML elements from one .xml file. This .xml file has commented tags as well. so i am planning to write Unix command/script which 1.will chekc for this .xml file 2. it will ignore the commented XML lines. i.e. XML tags between... (3 Replies)
Discussion started by: waiting4u
3 Replies

3. Red Hat

How to read an xml file through shell script?

Hey , can we read an xml file and make changes in it through shell script. Thanks (4 Replies)
Discussion started by: ramsavi
4 Replies

4. Shell Programming and Scripting

Shell Script to read XML file

Hi unix Gurus, I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information. For example <SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (5 Replies)
Discussion started by: SmilePlease
5 Replies

5. UNIX for Advanced & Expert Users

Shell Script to read XML tags and the data within that tag

Hi unix Gurus, I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information. For example <SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (2 Replies)
Discussion started by: SmilePlease
2 Replies

6. Shell Programming and Scripting

Unix Script to read the XML file from Website

Hi Experts, I need a unix shell script which can copy the xml file from the below pasted website and paste in in my unix directory. http://www.westpac.co.nz/olcontent/olcontent.nsf/fx.xml Thanks in Advance... (8 Replies)
Discussion started by: phani333
8 Replies

7. Shell Programming and Scripting

How to send email using shell script in UNIX, Is any environment setup required in Mac OS X ?

Hi All, I am using Mac OS X (Leopard OS). I am very new to UNIX. My requirement is that, by running a shell script, I create a log file. So I have to send a mail having that log file attached. What I tried to do is, I simply tried to check,whether this direct command works or not. So I... (2 Replies)
Discussion started by: Afreen
2 Replies

8. Shell Programming and Scripting

Help required on basic Unix Bourne Shell Script

Howdy People :), I'm a newbie & its my first question here. I've started learning Unix Bourne Shell scripting recently and struggling already :p Can someone PLEASE help me with the following problem. Somehow my script is not working. Display an initial prompt of the form: Welcome to... (1 Reply)
Discussion started by: methopoth
1 Replies

9. UNIX for Advanced & Expert Users

Shell script failing to read large Xml record-urgent critical help

Hi All, I have shell script running on AIX 5.3 box. It has 7 to 8 "sed" commands piped(|) together. It has a an Xml file as its input which has many records internally. There are certain record which which have more than hundered tags.The script is taking a huge amount of time more than 1.5 hrs... (10 Replies)
Discussion started by: aixjadoo
10 Replies

10. Shell Programming and Scripting

shell script required to convert rows to columns

Hi Friends, I have a log file as below siteid = HYD spc = 100 rset = RS_D_M siteid = DEL spc = 200 rset = RS_K_L siteid = DEL2 spc = 210 rset = RS_D_M Now I need a output like column wise as below. siteid SPC rset HYD 100 RS_D_M (2 Replies)
Discussion started by: suresh3566
2 Replies
Login or Register to Ask a Question
FOP-TTFREADER(1)					User Contributed Perl Documentation					  FOP-TTFREADER(1)

NAME
fop-ttfreader -- A tool which reads TTF files and generates XML font metrics file for use in FOP. SYNOPSIS
fop-ttfreader [options] fontfile.ttf xmlfile.xml OPTIONS
-enc ansi with this option you can create a WinAnsi encoded font. The default is to create a CID keyed font. If you're not going to use characters outside the pdfencoding range (almost the same as iso-8889-1) you can add this option. -ttcname fontname if you're reading data from TrueType Collection (.ttc file) you must specify which font from the collection you will read metrics from. If you read from a .ttc file without this option, the fontnames will be listed for you. -fn fontname default is to use the fontname in the .ttf file, but you can override that name to make sure that the embedded font is used (if you're embedding fonts) instead of installed fonts when viewing documents with Acrobat Reader. EXAMPLES
"fop-ttfreader /usr/share/fonts/truetype/freefont/FreeSerif.ttf freeserif.xml" generates freeserif.xml file containing XML font metrics from FreeSerif.ttf JAVA-WRAPPERS NOTE This program is a shell script wrapper based on java-wrappers(7). You therefore benefit from several features; please see the java- wrappers(7) manual page for more information about them. AUTHOR
Wrapper author: Arnaud Vandyck <avdyk@debian.org> SEE ALSO
fop(1), java-wrappers(7) Fop-TTFReader Sun Jan 15 11:24:34 UTC 2012 FOP-TTFREADER(1)