Since it's the quotes that determine whether a comma needs to be deleted, check on those.
When using " as the field separator, the first field will always be outside quotes, the second field always inside, the third field always outside, etc. So remove commas only from every second field. Then use " as the output separator too to prevent " being stripped...
It might be possible, considering that remove those comma's which has a space next to them. However the OP has to confirm that this assumption is good to go.
Code:
sed 's/, / /g' inputfile
This won't work. You didn't anchor the comma to letters. I have a million commas in my file. I only wanna remove the ones touching letters.
Hey guys,
I am very much new to shell scripts. So you ppl may feel that i am asking stupid question here. :D
1. I am using command line argument as an input variable. The user gets this value in his mail from client which has commas n spaces (Eg. 12,34,56,789) and the scripts... (5 Replies)
Hi,
Newbie here. I have a file that consists of data that I want to convert to a csv file. For example:
Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
Hello everyone I'm new here and this is my first post so first of all I want to say that this is a great forum and I have managed to found most of my answers in these forums : )
So with that I ask you my first question:
I have an excel file which I saved as a csv. However the excel file... (3 Replies)
Hi
Description of input file I have:
-------------------------
1) CSV with double quotes for string fields.
2) Some string fields have Comma as part of field value.
3) Have Duplicate lines
4) Have 200 columns/fields
5) File size is more than 10GB
Description of output file I need:... (4 Replies)
Hi ,
I have a file with below records
965382,10310858,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
767010,10217614,3,10217616,10217622,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,... (4 Replies)
i have data as below
123,"paul phiri",paul@yahoo.com,"po.box 23, BT","Eco Bank,Blantyre,Malawi"
i need an output to be
123,"paul phiri",paul@yahoo.com,"po.box 23 BT","Eco Bank Blantyre Malawi" (5 Replies)
In the attached file I am trying to remove all the "" and , (quotes and commas) from $2 and $3 and the "" (quotes) from $4.
I tried the below as a start:
awk -F"|" '{gsub(/\,/,X,$2)} 1' OFS="\t" enhancer.txt > comma.txt
Thank you :). (6 Replies)
Hello everyone, I have a dataset that looks something like:
1 3
2 2
3 4,5
4 3:9
5 5,9
6 5:6
I need to remove the rows that contain a comma in the second column and I'm not sure how to go about this. Here is an attempt.
awk 'BEGIN {FS=" "} { if ($2!==,) print }'Any help is appreciated. (5 Replies)
how to remove unwanted commas from a .csv file
Input file format
"Server1","server-PRI-Windows","PRI-VC01","Microsoft Windows Server 2012, (64-bit)","Powered On","1,696.12","server-GEN-SFCHT2-VMS-R013,server-GEN-SFCHT2-VMS-R031,server-GEN-SFCHT2-VMS-R023"... (5 Replies)
Discussion started by: ranjancom2000
5 Replies
LEARN ABOUT DEBIAN
ods-control
ods-control(8) OpenDNSSEC ods-control ods-control(8)NAME
ods-control - OpenDNSSEC control utility
SYNOPSIS
ods-control ksm ...
ods-control hsm ...
ods-control signer ...
ods-control start
ods-control stop
ods-control enforcer start
ods-control enforcer stop
ods-control enforcer notify
DESCRIPTION
ods-control is a helper utility which gives a combined interface for different command utilities within OpenDNSSEC. It can also start and
stop OpenDNSSEC by controlling the two daemons.
OPTIONS
ksm The remainder of the command line will be sent to the ods-ksmutil utility
hsm The remainder of the command line will be sent to the ods-hsmutil utility
signer The remainder of the command line will be sent to the ods-signer utility
start Will start the two daemons of OpenDNSSEC, ods-enforcerd and ods-signerd
stop Will stop the two daemons of OpenDNSSEC, ods-enforcerd and ods-signerd
enforcer start
Start the ods-enforcerd daemon without touching the ods-signerd and return non-zero on problems
enforcer stop
Stop the ods-enforcerd daemon without touching the ods-signerd and return non-zero on problems
enforcer notify
Notify the enforcer that its database has been updated and may need further processing by the KASP Enforcer.
SEE ALSO ods-auditor(1), ods-enforcerd(8), ods-hsmspeed(1), ods-hsmutil(1), ods-kaspcheck(1), ods-ksmutil(1), ods-signer(8), ods-signerd(8),
ods-timing(5), opendnssec(7), http://www.opendnssec.org/
AUTHORS
ods-control was written by Jakob Schlyter as part of the OpenDNSSEC project.
OpenDNSSEC February 2010 ods-control(8)