Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to split one long column into multiple rows with 3 each ? Post 303041340 by nengcheng on Thursday 21st of November 2019 01:09:09 PM
Old 11-21-2019
How to split one long column into multiple rows with 3 each ?

I have a large csv dataset like this :
A	value1
A	value2
A	value3
B	value1
B	value2
B	value3
C	value1
C	value2
C	value3

what I expected output is :
A	value1	value2	value3
B	value1	value2	value3
C	value1	value2	value3

I'm thinking of use like awk, columns , but haven't find a proper way to do that.
could anyone give me some clues?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Single Column into Multiple rows

i have single column which is starting with same string(many number of rows) i have to convert each into a single row.how can i do that? laknar std mes 23 55 laknar isd phone no address amount 99 I have to convert above like below. laknar|std|mes|23|55 laknar|isd|phone... (3 Replies)
Discussion started by: laknar
3 Replies

2. UNIX for Dummies Questions & Answers

split one column into multiple columns

hey guys... Im looking to do the following: 1 2 3 4 5 6 7 8 9 Change to: 1 4 7 2 5 8 3 6 9 Did use | perl -lpe'$\=$.%3?$":"\n"' , but it doesnt give me the matrix i want. (3 Replies)
Discussion started by: zaneded
3 Replies

3. Shell Programming and Scripting

split one column into multiple columns

hey, i have the following data: 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 (7 Replies)
Discussion started by: zaneded
7 Replies

4. Shell Programming and Scripting

Single column into multiple rows

Hi all, I need to convert this file having just one column into two column file current file: a 15 b 21 c 34 d 48 e 10 wanted: a 15 b 21 c 34 (15 Replies)
Discussion started by: prachiagra
15 Replies

5. Shell Programming and Scripting

Breaking a column's value into multiple rows

Hello Friends, I am trying to implement the following using UNIX. I am getting a sequential file as input which would have two columns, "Name" and "Countries Visited". The "Countries Visisted" field will be multi-valued, each value separated by a space and also the number of values are not... (2 Replies)
Discussion started by: mehimadri
2 Replies

6. Shell Programming and Scripting

Split single rows to multiple rows ..

Hi pls help me out to short out this problem rm PAB113_011.out rm: PAB113_011.out: override protection 644 (yes/no)? n If i give y it remove the file. But i added the rm command as a part of ksh file and i tried to remove the file. Its not removing and the the file prompting as... (7 Replies)
Discussion started by: sri_aue
7 Replies

7. Shell Programming and Scripting

Converting Single Column into Multiple rows, but with strings to specific tab column

Dear fellows, I need your help. I'm trying to write a script to convert a single column into multiple rows. But it need to recognize the beginning of the string and set it to its specific Column number. Each Line (loop) begins with digit (RANGE). At this moment it's kind of working, but it... (6 Replies)
Discussion started by: AK47
6 Replies

8. Shell Programming and Scripting

Convert single column into multiple rows

Convert Single column to multiple rows file a.txt contains data like below Server=abc Run=1 Tables=10 Sessions=16 Time=380 Jobs=5 Server=abc Run=2 Tables=15 Sessions=16 Time=400 Jobs=5 Server=abc Run=3 Tables=20 Sessions=16 Time=450 (5 Replies)
Discussion started by: sol_nov
5 Replies

9. Shell Programming and Scripting

awk split columns after matching on rows and summing the last column

input: chr1 1 2 3 chr1 1 2 4 chr1 2 4 5 chr2 3 6 9 chr2 3 6 10 Code: awk '{a+=$4}END{for (i in a) print i,a}' input Output: chr112 7 chr236 19 chr124 5 Desired output: chr1 1 2 7 chr2 3 6 19 chr1 2 4 5 (1 Reply)
Discussion started by: jacobs.smith
1 Replies

10. UNIX for Beginners Questions & Answers

Split column into rows

Hi, I have input dataset as below: Cl.jenn,1051,ABCD JEN.HEA,9740|1517|8119|2145,ZZZZ,REPEAT Rich.Sm, Ann.Car,3972|4051|1064|4323|4122|2394|2574|4507 Sta.for,7777,ABCD,UUUU Sm.Ric, Ch.LRD, Eh.ab, Gr.sh, Expected output: ------------------- Cl.jenn,1051,ABCD... (6 Replies)
Discussion started by: saravananravim
6 Replies
SEXTRACTOR(1)							   User Commands						     SEXTRACTOR(1)

sextractor - extract a source catalog from an astronomical FITS image SYNOPSIS
sextractor image [-c configuration-file] [-parameter1 value1 -parameter2 value2 ...] sextractor image_detect image_measure [-c configuration-file] [-parameter1 value1 -parameter2 value2 ...] sextractor -d DESCRIPTION
SExtractor is a program that builds a catalogue of objects from an astronomical image. Although it is particularly oriented towards reduc- tion of large scale galaxy-survey data, it performs rather well on moderately crowded star fields. On Debian systems, sample SExtractor parameter files are installed to /usr/share/sextractor. Operation modes: -h, --help print this help, then exit -V, --version print version number, then exit -d, --dump dump a default configuration file EXAMPLE
For a minimal sextractor run, without customizing any of the parameters, use sextractor file.fits -c /usr/share/sextractor/default.sex -PARAMETERS_NAME /usr/share AUTHOR
Written by Emmanuel Bertin (Institut d'Astrophysique de Paris and Observatoire de Paris). Copyright 1994-2005 Emmanuel Bertin This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. REPORTING BUGS
Report bugs to <sextractor@iap.fr>. The full documentation for SExtractor is maintained as a Postscript manual available at http://terapix.iap.fr/soft/sextractor ; on Debian systems, it is also installed to /usr/share/doc/sextractor/. SExtractor 2.8.6 January 2013 SEXTRACTOR(1)

Featured Tech Videos

All times are GMT -4. The time now is 09:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy