09-21-2010
Sorting multi-column values from a specific file
Hi, all.
I need a shell script which gathers data from a remote XML file and then displays it according to my needs.. I need this for my job due to the fact that I need to keep track price changes of euro, usd, gold, etc.
The XML file I am talking about is located at this page: cnnturk dot com/finans/ticker/endeks.asp
The reason I am posting the URL is that I need to use curl to get this file and it does NOT have newlines after each tag. I thought that that would be a problem.
Here is what I need from the script:
1) curl to get the page
2) make use of sed, awk, etc. to display its contents in a more structured and readable manner as shown below:
A: 64.125 (% -0.26)
B: 81.130 (% -0.32)
C: 1.4930 (% 0.00)
D: 1.9590 (% 0.36)
I am looking forward to your insights..
Thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Good morning. I have a piece of code that is currently taking multiple files and using the CAT.exe command to combine into one file that is then sorted in reverse order based on the 3rd field of the file, then displayed on screen. I am trying to change this so that the files are being combined into... (4 Replies)
Discussion started by: jaacmmason
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a space de-limited text file. In the fifth column, I would like to switch "1"s with "2"s. How do I go about doing that? Thanks!
Sample input:
0 311000259 0 0 1 1
0 311000397 0 0 1 2
0 311000491 0 0 2 1
0 311000516 0 0 2 1
0 311000541 0 0 1 1
0 311000558 0 0 2 1
0 311000566 0... (1 Reply)
Discussion started by: evelibertine
1 Replies
3. Shell Programming and Scripting
Hi,
I have a problem where I need to make this input:
nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a
nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b
look like this output:
nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies
4. UNIX for Dummies Questions & Answers
Dear All,
i have a column with values in excel table:
ATGC22327-p66
ATGC15922-p239
ATGC12710-p21743567
ATGC08037-p186
ATGC07969-p173
ATGC07345-p48534
ATGC02767-p254234
ATGC02124-p2177451
ATGC02124-p1459
ATGC01930-p3005 I need to... (6 Replies)
Discussion started by: AAWT
6 Replies
5. Shell Programming and Scripting
Hello friends,
I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below..
1. 18th-col-value 19th-col-value 2. 20th-col-value ... (5 Replies)
Discussion started by: prvnrk
5 Replies
6. Shell Programming and Scripting
Hi all:
quick question!
I have the following data that resembles some thing like this:
i am tired
tired am i
what is up
hello people cool
I want to count (or at least isolate) all of the unique elements in the 2nd column.
I have tried this:
cut -f 2 | uniq 'input'
which does... (3 Replies)
Discussion started by: owwow14
3 Replies
7. Shell Programming and Scripting
I have a file (let say file B) like this:
File B:
A1 3 5
A1 7 9
A2 2 5
A3 1 3
The first column defines a filename and the other two define a range in that specific file. In the same directory, I have also three more files (File A1, A2 and A3). Here is 10 sample lines... (3 Replies)
Discussion started by: Bastami
3 Replies
8. Shell Programming and Scripting
What im trying to do is sort the output by the number on the second column and than limit the result to only the first three lines.
This is the code
idlist="x23s52; f34233; 2343xs; 25x34; si342d"
cntr=1
idcnt=$(print $nidlist |tr ';' '\n' |wc -l)
numofgrps=0
while (($cntr <= $idcnt))... (3 Replies)
Discussion started by: ajetangay
3 Replies
9. Shell Programming and Scripting
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
10. Programming
Hi Team
I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows .
For example :
Column 1 Column2
Jan,Feb Hold,Sell,Buy
Expected Result
Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies
LEARN ABOUT DEBIAN
xml2-config
GNOME-XML(1) 1.1.0 GNOME-XML(1)
NAME
xml-config - script to get information about the installed version of GNOME-XML
SYNOPSIS
xml-config [--prefix[=DIR]] [--libs] [--cflags] [--version] [--help]
DESCRIPTION
xml-config is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use
GNOME-XML.
OPTIONS
xml-config accepts the following options:
--version
Print the currently installed version of GNOME-XML on the standard output. Add the --static option to print the linker flags that
are necessary to statically link a GNOME-XML program.
--libs Print the linker flags that are necessary to link a GNOME-XML program.
--cflags
Print the compiler flags that are necessary to compile a GNOME-XML program.
--prefix=PREFIX
If specified, use PREFIX instead of the installation prefix that GNOME-XML was built with when computing the output for the
--cflags and --libs options. This option must be specified before any --libs or --cflags options.
AUTHOR
This manual page was written by Fredrik Hallenberg <hallon@lysator.liu.se>, for the Debian GNU/linux system (but may be used by others).
Version 3 July 1999 GNOME-XML(1)