Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Replace newline with comma and append quotes Post 303034249 by Rtk on Monday 22nd of April 2019 10:02:41 PM
Old 04-22-2019
Replace newline with comma and append quotes

Hi,

I have below requirement.
Code:
Apple
Orange
Banana

Required O/p in bash
Code:
'Apple,Orange,Banana'

Can you please help.

Moderator's Comments:
Mod Comment Please wrap your samples, codes in CODE TAGS as per forum rules.

Last edited by RavinderSingh13; 04-22-2019 at 11:10 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace comma with newline

Hi, for some reason I cant seem to figure this out. I have a file which looks something like this word word word word word,word,word word word word,word,word,word,word word word Basically I want this whole thing to be a list with 1 word on each line like this... word word word... (1 Reply)
Discussion started by: eltinator
1 Replies

2. Shell Programming and Scripting

To Replace comma with Pipe inside double quotes

Hi, I have a requirement to replace the comma's inside the double quotes. The comma's inside the double quotes will get changed dynamically. Input Record: "Washington, DC,Prabhu,aju",New York Output Record: "Washington| DC|Prabhu|aju",New York I tried with the below command but it... (3 Replies)
Discussion started by: prabhutkl
3 Replies

3. Shell Programming and Scripting

Replace newline with comma.

I have output from a file like this: 15,01,11,14:06 235 I would like to change this to: 15,01,11,14:06,235 Removing newline and change to "," I now this can be done with tr cat OUT | tr '\n' ','' My problem is that tr is not implemented in this shell. sed is, show it should be... (7 Replies)
Discussion started by: Jotne
7 Replies

4. Shell Programming and Scripting

shell script - to append single quotes and comma

file1 ---- 34556745 32678343 31576776 31455566 21356666 I want to assign the record values to a variable in the below format, so that I can use output in .sql file for querying in database. ('34556745', '32678343', '31576776', '31455566', '21356666') ----------- below is the... (11 Replies)
Discussion started by: rajivrsk
11 Replies

5. Shell Programming and Scripting

Replace newline character between a double quotes to a space

Hi Guys, I have a file with content as below aj.txt "Iam allfine" abcdef abcd "all is not well" What I'm trying to say is my data has some new line characters in between quoted text. I must get ride of the newline character that comes in between the quoted text. output must be:... (8 Replies)
Discussion started by: ajahuja
8 Replies

6. Shell Programming and Scripting

Replace comma delimiter by newline

The input file is as below AR,age,marks,roll,section,evin,25,80,456,A,atch,23,56,789,B,eena,24 ,78H245,C,Ps,ot,ecessary,hat,ame comes first then age and rest AR AZ,kevin,25,80,456,A,Satch,23,56,789,Satch,23,56,789,B,Meena,24,78,H245,C,AZ ................ ................ I am writting... (8 Replies)
Discussion started by: millan
8 Replies

7. Shell Programming and Scripting

How to replace NewLine with comma using sed?

Hi , I have a huge file with following records and I want to replace the last comma with ',NULL'. I try using SED but could not create a correct script . In my opinion I need a script which can convert ,/n with ,NULL/n 1,CHANGE_MEMBER,2010-12-28 00:05:00, 2,CHANGE_MEMBER,2012-09-02... (8 Replies)
Discussion started by: Ajaypal
8 Replies

8. Shell Programming and Scripting

Command to replace newline with comma

Hi Experts, I need an urgent help in replacing newline characters in my single column file by a comma. I am using following command for this purpose: sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}' parameter.rtf | rev | cut -c 4- | revMy input file has: TABLE_1 TABLE_2 TABLE_3 What I need:... (11 Replies)
Discussion started by: neerndg123
11 Replies

9. Programming

Replace comma which is not inside brackets,quotes or paranthesis

Hi All, I want to replace the commas which are not inside parenthesis,quotes if input is abc,,lm,(no,pq,rs),{tu,vw,xy},zs,"as,as,fr",'ab,cd,ef' output should be abc lm (no,pq,rs) {tu,vw,xy} zs "as,as,fr" 'ab,cd,ef' I tried this str.replaceAll("\\(.*?\\)|(,)", " "); say my string... (3 Replies)
Discussion started by: preethy
3 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
IPHETH(4)						   BSD Kernel Interfaces Manual 						 IPHETH(4)

NAME
ipheth -- USB Apple iPhone/iPad tethered Ethernet driver SYNOPSIS
To load the driver as a module at boot time, place the following line in loader.conf(5): if_ipheth_load="YES" Alternatively, to compile this driver into the kernel, place the following lines in your kernel configuration file: device uhci device ohci device usb device ipheth DESCRIPTION
The ipheth driver provides support for network access through Apple iPhone and iPad devices, often referred to as USB tethering. ipheth should work with any Apple iPhone or iPad device. In most cases this must be explicitly enabled on the device first. For more information on configuring this device, see ifconfig(8). The device does not support different media types or options. HARDWARE
The following devices are supported by the ipheth driver: o Apple iPhone tethering (all models) o Apple iPad tethering (all models) SEE ALSO
arp(4), cdce(4), intro(4), netintro(4), urndis(4), usb(4), ifconfig(8), usbconfig(8) HISTORY
The ipheth device driver first appeared in FreeBSD 8.2. AUTHORS
The ipheth driver was written by Hans Petter Selasky <hselasky@FreeBSD.org>. BUGS
Some devices may need to be manually configured to use an alternative configuration with the usbconfig(8) utility. A command similar to usbconfig -u 1 -a 2 set_config 3 may be required if the device is not recognised automatically by ipheth after it is connected. BSD
September 30, 2014 BSD
All times are GMT -4. The time now is 04:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy