Sponsored Content
Top Forums UNIX for Advanced & Expert Users AIX put comma separated data on its own line Post 303040143 by MadeInGermany on Thursday 24th of October 2019 01:12:12 AM
Old 10-24-2019
\n being a newline is specific to GNU sed.
Put a \newline
Code:
sed 's/[,.!?]  */&\
/g' /tmp/ports
sed 's/[,.!?]  */\
/g' /tmp/ports

The 'two
lines'
string work in all Bourne/Posix compatible shells. The GNU extension also supports csh and tcsh shells.
This User Gave Thanks to MadeInGermany For This Post:
 

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

printing sequence of line no. with comma separated

Kindly i want to concatenate every 12 lines ina file, using a comma separator between fields (each line)? can anyone help please? thanks a lot in advance. (5 Replies)
Discussion started by: m_wassal
5 Replies

3. Shell Programming and Scripting

reading comma separated data and reorder

hey guys! i need to read data from a file that are comma separated then reorder them in another file to be generated for example: x,y,z a,b,c l,m,n o,p,q and transform this into: x,a,l,o y,b,m,p z,c,n,q Will appreciate your fast reply Regards! (5 Replies)
Discussion started by: maiooi90
5 Replies

4. Shell Programming and Scripting

Parsing and filtering multiline text into comma separated line

I have a log file that contains several reports with following format. <Start of delimiter> Report1 header Report1 header continue Report1 header continue Record1 header Record1 header continue Record1 header continue field1 field2 field3 field4 ------... (1 Reply)
Discussion started by: yoda9691
1 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

Combining multiple block of lines in one comma separated line

Hi Everyone, On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies

9. Shell Programming and Scripting

awk to change comma separated line to horizontal

I am trying to change a file that looks like this: file, announcement,date, server, server01, server02, server06, file04, rec01, rec04, rec03... etc into a vertical file like this: file announcement date server server01 server02 server06 The file does not have to be sorted... (5 Replies)
Discussion started by: newbie2010
5 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
Debian::Control::Stanza::CommaSeparated(3pm)		User Contributed Perl Documentation	      Debian::Control::Stanza::CommaSeparated(3pm)

NAME
Debian::Control::Stanza::CommaSeparated - comma separated debian/control field abstraction SYNOPSYS
my $f = Debian::Control::Stanza::CommaSeparated->new( 'Joe M <joem@there.not>'); $f->add('"Smith, Agent" <asmith@hasyou.not>, Joe M <joem@there.not>'); print $f->as_string; # 'Joe M <joem@there.not>, "Smith, Agent" <asmith@hasyou.not>' print "$f"; # the same $f->sort; DESCRIPTION
Debian::Control::Stanza::CommaSeparated abstracts handling of comma-separated list of values, often found in debian/control file fields like Uploaders. Note that the various dependency fields in debian/control also use comma-separated values, but the Debian::Dependencies class is more suitable for these as it is for example also capable of finding overlapping dependency declarations. CONSTRUCTOR
new (initial values) The initial values list is parsed and may contain strings that are in fact comma-separated lists. These are split appropriately using Text::ParseWords' quotewords routine. METHODS
as_string Returns text representation of the list. A simple join of the elements by ", ". The same function is used for overloading the stringification operation. add @items Adds the ginen items to the list. Items that are already present are not added, keeping the list unique. sort A handy method for sorting the list. perl v5.14.2 2012-01-15 Debian::Control::Stanza::CommaSeparated(3pm)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy