Sponsored Content
Full Discussion: Separate Entries after comma
Top Forums Shell Programming and Scripting Separate Entries after comma Post 302752393 by kareena on Monday 7th of January 2013 01:54:38 AM
Old 01-07-2013
Separate Entries after comma

Hi All

I need help to separate entries after commas in my

I have 2 columns in my file like this

Code:
Ramush, Shyam, Mohan              First

Ram, Mohan, Kaavya              Second, Fourth

Kavi, Ram, Shaym, Mohan         Third

I ahve to separate entries after comma in a separate row

Like expected output is


Code:
Ramush               First
Shyam               First
Mohan                First
Ram,               Second
Mohan              Second
Kaavya            Second 
Ram                  Fourth
Mohan               Fourth
Kaavya              Fourth
Kavi         Third
Ram             Third
Shaym       Third
Mohan         Third

Kindly let me know scripting regarding this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

count data separate by comma

hi experts, i have some problem with count data which separate by comma, below sample data : 01,011222823b6d,011222823f29,0028a5,002993,6212345678, 659111111111,6598204507,6281105008,6596197849,_,525016160836958,_, ffffffff,000000000000000000000000,_,_,_,fd,fd,ff,00,1,0028a5-002993,_,... (10 Replies)
Discussion started by: bucci
10 Replies

2. Shell Programming and Scripting

using diff to on two file but ignoring the last comma separate value

Hi guys I have two file which I sdiff. ie file 1: AA,12,34,56,,789,101,,6666 file 2: AA,12,34,56,,789,101,,7777 The last comma separated value will always change from one day to the next. Is there another unix utility I can use that will sdiff two files but ignore the last comma... (1 Reply)
Discussion started by: wny201
1 Replies

3. Shell Programming and Scripting

How to grep after the first comma till the next comma in a line

Hi Can any one pls tell me how to grep this line POPULATION,69691,20120509 I want the number 69691 from the above line. How to grep from the first comma till the next comma. Thank You.:confused: (8 Replies)
Discussion started by: rxg
8 Replies

4. Shell Programming and Scripting

Separate certain entries from a very big file

Hello I have to separate certain entries from a Big file with so many drugs and description I want to seaprate only Drug name which is mentioned as #BEGIN_DRUGCARD DB00001(means first drug description initiated) ..same way DB00002...and so on and in description I have to separate #... (3 Replies)
Discussion started by: manigrover
3 Replies

5. Shell Programming and Scripting

separate old entries

Hi I have a file Stomach qwe wer qwew Liver sdfjk shdf jkasfhd I want expected out shuld be in such a way that bold letters shuld comein front of non bold letter qwe Stomach wer Stomach qwew Stomach sdfjk Liver shdf Liver... (8 Replies)
Discussion started by: manigrover
8 Replies

6. 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

7. Shell Programming and Scripting

Remove bracket part entires and separate entries after comma

Hi all This time my input conatin 3 columns: ERCC1 (PA155) Platinum compounds (PA164713176) Allele A is not associated with response to Platinum compounds in women with Ovarian Neoplasms as compared to allele C . CES1 (PA107) methylphenidate (PA450464) Genotype CT is not... (4 Replies)
Discussion started by: Priyanka Chopra
4 Replies

8. Shell Programming and Scripting

Match first column and separate entries

Hi I have 2 big files containing following information: file 1 12345 345634 217341 87234693 8236493 file 2: 12345 1237 (6 Replies)
Discussion started by: kaav06
6 Replies

9. UNIX for Advanced & Expert Users

Comma separate issue in UNIX

In awk the field seprator is not working properly, I am trying to cut the fields from the file based on the delimiter example comma (,) awk -F, "{print {$1 FS $3 FS $5 FS FS $2}}" Sample.csv But i am not getting desired output can anyone help me how to check real ascii comma there in my... (9 Replies)
Discussion started by: rspwilliam
9 Replies

10. 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
PR(1)							      General Commands Manual							     PR(1)

NAME
pr - print file SYNOPSIS
pr [ option ... ] [ file ... ] DESCRIPTION
Pr produces a printed listing of one or more files on its standard output. The output is separated into pages headed by a date, the name of the file or a specified header, and the page number. With no file arguments, pr prints its standard input. Options apply to all following files but may be reset between files: -n Produce n-column output. +n Begin printing with page n. -b Balance columns on last page, in case of multi-column output. -d Double space. -en Set the tab stops for input text every n spaces. -h Take the next argument as a page header (file by default). -in Replace sequences of blanks in the output by tabs, using tab stops set every n spaces. -f Use formfeeds to separate pages. -ln Take the length of the page to be n lines instead of the default 66. -m Print all files simultaneously, each in one column. -n Number the lines of each file. -on Offset the left margin n character positions. -sc Separate columns by the single character c instead of aligning them with white space. A missing c is taken to be a tab. -t Do not print the 5-line header or the 5-line trailer normally supplied for each page. -wn For multi-column output, take the width of the page to be n characters instead of the default 72. SOURCE
/sys/src/cmd/pr.c SEE ALSO
cat(1), lp(1) PR(1)
All times are GMT -4. The time now is 05:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy