Parsing multipe data entries


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Parsing multipe data entries
# 8  
Old 05-18-2011
Code:
man xargs

Also condsider the following example :

Code:
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II"
A
BBB CCC DDDD
EE FFFF
GGG HHH II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs
A BBB CCC DDDD EE FFFF GGG HHH II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs -n2
A BBB
CCC DDDD
EE FFFF
GGG HHH
II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs -n3
A BBB CCC
DDDD EE FFFF
GGG HHH II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs -n4
A BBB CCC DDDD
EE FFFF GGG HHH
II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs -n5
A BBB CCC DDDD EE
FFFF GGG HHH II
# echo "A\nBBB CCC DDDD\nEE FFFF\nGGG HHH II" | xargs -i echo :{}:
:A:
:BBB CCC DDDD:
:EE FFFF:
:GGG HHH II:
#

---------- Post updated at 01:17 PM ---------- Previous update was at 01:15 PM ----------

In your case you dont even need xargs since it looks like paste can handle the wildcard in a way we expect :

Code:
paste -sd " " PMT_GGSN_WPP_APN-20110517*

This User Gave Thanks to ctsgnb For This Post:
# 9  
Old 05-18-2011
great Thanks again for your help!

---------- Post updated at 06:33 AM ---------- Previous update was at 06:21 AM ----------

strange

when I run
Code:
 paste -sd " "  PMT_GGSN_WPP_APN-$DATE*

from cmd line it runs fine
when i run via script it doesnt contain same format at all!!!

something to do with the redirect !!!
Code:
paste -sd " "  PMT_GGSN_WPP_APN-20110517*  > outfile

running SunOS alps 5.10 Generic_125100-05 sun4v sparc SUNW,Sun-Fire-T200

Last edited by rob171171; 05-18-2011 at 08:43 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing XML (and insert data) then output data (bash / Solaris)

Hi folks I have a script I wrote that basically parses a bunch of config and xml files works out were to add in the new content then spits out the data into a new file. It all works - apart from the xml and config file format in the new file with XML files the original XML (that ends up in... (2 Replies)
Discussion started by: dfinch
2 Replies

2. Shell Programming and Scripting

Parsing file data

Hey Guys, I'm a novice at shell scripts and i need some help parsing file data. Basically, I want to write a script that retrieves URLs. Here is what I have so far. #!/bin/bash echo "Please enter start date (format: yyyy-mm-dd):\c" read STARTDATE echo "Please enter end date... (7 Replies)
Discussion started by: silverdust
7 Replies

3. Shell Programming and Scripting

Help with parsing data with awk , eliminating unwanted data

Experts , Below is the data: --- Physical volumes --- PV Name /dev/dsk/c1t2d0 VG Name /dev/vg00 PV Status available Allocatable yes VGDA 2 Cur LV 8 PE Size (Mbytes) 8 Total PE 4350 Free PE 2036 Allocated PE 2314 Stale PE 0 IO Timeout (Seconds) default --- Physical volumes ---... (5 Replies)
Discussion started by: rveri
5 Replies

4. Shell Programming and Scripting

Parsing iostat data

Hello, I searched the forum and found the parsing iostat data in real time but that does not help me. What I would like to do is to parse the iostat data that has been gathered. Below is an example of the iostat output: System configuration: lcpu=4 drives=5 ent=0.10 paths=20 vdisks=2 ... (11 Replies)
Discussion started by: tommyd
11 Replies

5. Shell Programming and Scripting

Data parsing

Hi, I do have a data file which is divided into compartments by ---------. I would like to extract (parse) some of the data and numbers either using awk or sed The file has the format: CATGC Best GO enrichment: Genes/ORF that have the motifs (genes are sorted by max(pa+pd+po)): ... (6 Replies)
Discussion started by: Lucky Ali
6 Replies

6. Shell Programming and Scripting

Help in Parsing data

I have below string Transaction_ID:SDP-DM-151204679 , Transaction_DateTime:2011-02-11 00:00:15 GMT+05:30 , Transaction_Mode:WAP , Circle_ID:4 , Circle_Name:BJ ,Zone: , CustomerID:B_31563486 , MSISDN:7870904329 , IMSI:405876122068099 , IMEI: , Sub_Profile:Pre-Paid , CPID:Nazara , CPNAME:Nazara ,... (6 Replies)
Discussion started by: poweroflinux
6 Replies

7. Shell Programming and Scripting

Parsing the data

Hi friends, I need to parse the following data in the given format and get the desired output. I need a function, which takes the input as a parameter and the desired output will be returned from the function. INPUT(single parameter as complete string) A;BCF;DFG;FD ... (3 Replies)
Discussion started by: sumesh.1988
3 Replies

8. Shell Programming and Scripting

Parsing data

Hi all , I have a file with billing CDR records in it. I need to parse that information (row format) . The purpose is to compare full content. The example I have given below is a single line record but it has two portions, (1) the line start with “!” and end with “1.2.1.8” and (2) second part... (5 Replies)
Discussion started by: jaygamini
5 Replies

9. Shell Programming and Scripting

More efficent Data Parsing

I am looking for a way to parse out some numbers from text. This is an excerpt from a larger script that I am trying to make run a little smoother. Specifically this script is used to Capture DV video streams on a linux machine from the terminal. The setup does 6 streams at once, and this part... (3 Replies)
Discussion started by: Starcast
3 Replies

10. Shell Programming and Scripting

Parsing the data

Hi I need to parse the following data using shell script Table ----- stage4n_abc 48 stage4o_abcd 4 adashpg_abc_HeartBeat 1 stage4l_asc 168 Can anyone gimme the solution. I want each value to get stored in an array or variable and want the value to be greped from another file.... (1 Reply)
Discussion started by: Archana.Dheepan
1 Replies
Login or Register to Ask a Question