Sponsored Content
Top Forums Shell Programming and Scripting reading comma separated data and reorder Post 302511665 by bartus11 on Thursday 7th of April 2011 09:46:15 AM
Old 04-07-2011
Try:
Code:
perl -F, -alne 'for ($i=0;$i<=$#F;$i++){push @{$h{$i}},$F[$i]}END{for ($i=0;$i<=$#F;$i++){$,=",";print @{$h{$i}}}}' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse apart strings of comma separated data with varying number of fields

I have a situation where I am reading a text file line-by-line. Those lines of data contain comma separated fields of data. However, each line can vary in the number of fields it can contain. What I need to do is parse apart each line and write each field of data found (left to right) into a file.... (7 Replies)
Discussion started by: 2reperry
7 Replies

2. Shell Programming and Scripting

help:Reading width separated data

Hi, I'm quite new to unix script, and is having some problems currently. Say for the following sample project: The sql result is stored in a file >sql.txt. The result is shown (sample table): ID Price Tag Name ----- ------- ----- -------- A 100 test1 test1 B ... (6 Replies)
Discussion started by: lornen81
6 Replies

3. Shell Programming and Scripting

Reading comma separated variable into other variables in shell script

Hi, In shell script, I have a variable var = xyz, inn, day, night, calif ....n and I would like to read them in to var1 = xzy, var2 = inn, var3= day, var4 = night....var. probably in a loop. I would like to read the variables until end of the line. Comma is the delimiter and there's no comma at... (3 Replies)
Discussion started by: suryaemlinux
3 Replies

4. Shell Programming and Scripting

Comma separated file

Hi all, I have the following files types: FileA: 100, 23, 33, FileB: 22, 45, 78, and i want to make File C: 100,22 23,45 33,78 any nice suggestions for making it easy. (3 Replies)
Discussion started by: hen1610
3 Replies

5. Shell Programming and Scripting

Need Help - comma inside double quote in comma separated csv,

Hello there, I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process. Input in the csv file is , 1,234,"abc,12,gh","GH234TY",34 I need output like below,... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

6. Shell Programming and Scripting

Reading Words separated by comma in line

Hi All, I am facing issue, to read words in line, line as follow and i want to read word at each comma 1,you,are,two So i want read like 1 you are two Thanks (1 Reply)
Discussion started by: sujit_kashyap
1 Replies

7. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

8. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies

9. UNIX for Beginners Questions & Answers

How to extract fields from a CSV i.e comma separated where some of the fields having comma as value?

can anyone help me!!!! How to I parse the CSV file file name : abc.csv (csv file) The above file containing data like abv,sfs,,hju,',',jkk wff,fst,,rgr,',',rgr ere,edf,erg,',',rgr,rgr I have a requirement like i have to extract different field and assign them into different... (4 Replies)
Discussion started by: J.Jena
4 Replies

10. UNIX for Advanced & Expert Users

AIX put comma separated data on its own line

In Linux you can do this to put comma separated data on its own line like this. sed 's/ */&\n/g' /tmp/ports sed 's/ */\n/g' /tmp/ports How do you do this in AIX? It is not working. Is there another way to do this? Something like this. 1, 2, 3, 4 To look like this. 1 2 3 4 (4 Replies)
Discussion started by: cokedude
4 Replies
REORDERBDDSYSTEMDYNAMIC(3)					   BDD FUNCTIONS					REORDERBDDSYSTEMDYNAMIC(3)

NAME
reorderbddsystemdynamic - specifies the dynamic bdd reorder parameters. ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "bdd101.h" void reorderbddsystemdynamic( BddSystem, ReorderFunc, ReorderLow, ReorderRatio ) bddsystem *BddSystem; void (*ReorderFunc)(); long ReorderLow; long ReorderRatio; PARAMETERS
BddSystem The bdd system. ReorderFunc The dynamic reorder method. ReorderLow The minimum number of bdd nodes. ReorderRatio The reorder ratio in percent. DESCRIPTION
reorderbddsystemdynamic specifies to parameters for the dynamic reorder in the bdd system BddSystem. If a null pointer is given, the default bdd system is used. If the number of bdd nodes is greater than ReorderLow, then the dynamic reorder function ReorderFunc is called. The new reorder limit is computed as the product of the number of bdd nodes and the ReorderRatio value plus 100. If this limit is less than ReorderLow then the new limit is fixed to ReorderLow. If the function ReorderFunc is a null pointer, then the dynamic reorder process is skipped. RETURN VALUE
reorderbddsystemdynamic returns nothing. EXAMPLE
#include "bdd101.h" bddsystem *BddSystem; BddSystem = createbddsystem( 100, 1000, 100, 50000 ); reorderbddsystemdynamic( BddSystem, reorderbddsystemwindow, 1000, 50 ); ... destroybddsystem( BddSystem ); SEE ALSO
bdd(1) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 REORDERBDDSYSTEMDYNAMIC(3)
All times are GMT -4. The time now is 12:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy