Is it possible to put double quotes in just a few columns using sed?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm doing my course completion work where I need to manipulate some columns of a .csv file that has six hundred thousand lines. I have already searched in several forums on sed and awk and I did not find anything like it (and unfortunately my knowledge about Linux is not very deep). What I found generally handles only one column or all ... what I need is to put double quotes only in the first, fifth, and sixth columns.
For example:
2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123
To be
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
Still, maybe I still change some column since I'm just starting in data mining and I do not know what the configuration will be like in a few weeks, so if you can do a brief syntax of logic, I'll be eternally grateful.
text-processing sed csv columns
 |Â
show 1 more comment
up vote
1
down vote
favorite
I'm doing my course completion work where I need to manipulate some columns of a .csv file that has six hundred thousand lines. I have already searched in several forums on sed and awk and I did not find anything like it (and unfortunately my knowledge about Linux is not very deep). What I found generally handles only one column or all ... what I need is to put double quotes only in the first, fifth, and sixth columns.
For example:
2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123
To be
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
Still, maybe I still change some column since I'm just starting in data mining and I do not know what the configuration will be like in a few weeks, so if you can do a brief syntax of logic, I'll be eternally grateful.
text-processing sed csv columns
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What I found generally handles only one column or allplease add those to question.. it will show your research effort..
â Sundeep
Apr 12 at 4:07
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
2
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09
 |Â
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm doing my course completion work where I need to manipulate some columns of a .csv file that has six hundred thousand lines. I have already searched in several forums on sed and awk and I did not find anything like it (and unfortunately my knowledge about Linux is not very deep). What I found generally handles only one column or all ... what I need is to put double quotes only in the first, fifth, and sixth columns.
For example:
2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123
To be
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
Still, maybe I still change some column since I'm just starting in data mining and I do not know what the configuration will be like in a few weeks, so if you can do a brief syntax of logic, I'll be eternally grateful.
text-processing sed csv columns
I'm doing my course completion work where I need to manipulate some columns of a .csv file that has six hundred thousand lines. I have already searched in several forums on sed and awk and I did not find anything like it (and unfortunately my knowledge about Linux is not very deep). What I found generally handles only one column or all ... what I need is to put double quotes only in the first, fifth, and sixth columns.
For example:
2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123
To be
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
Still, maybe I still change some column since I'm just starting in data mining and I do not know what the configuration will be like in a few weeks, so if you can do a brief syntax of logic, I'll be eternally grateful.
text-processing sed csv columns
edited Apr 12 at 1:04
Jeff Schaller
31.1k846105
31.1k846105
asked Apr 12 at 0:15
Felipe Duarte
62
62
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What I found generally handles only one column or allplease add those to question.. it will show your research effort..
â Sundeep
Apr 12 at 4:07
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
2
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09
 |Â
show 1 more comment
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What I found generally handles only one column or allplease add those to question.. it will show your research effort..
â Sundeep
Apr 12 at 4:07
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
2
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What I found generally handles only one column or all please add those to question.. it will show your research effort..â Sundeep
Apr 12 at 4:07
What I found generally handles only one column or all please add those to question.. it will show your research effort..â Sundeep
Apr 12 at 4:07
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
2
2
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09
 |Â
show 1 more comment
4 Answers
4
active
oldest
votes
up vote
4
down vote
Using csvtool which has a helpful format command:
csvtool format '"%1",%2,%3,%4,"%5","%6"n' file.csv
Example:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool format '"%1",%2,%3,%4,"%5","%6"n' -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
csvtool also can call shell functions and external programs to parse lines from .CSV files. To do the same thing using printf, but print the "123" in hexadecimal, do:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool call "printf '"%s",%s,%s,%s,"%s","%x"n'" -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","7b"
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
add a comment |Â
up vote
2
down vote
I might approach it with awk this way:
- set the output field separator to what the input field separator is, which we assign as the comma
-F, - for each line, reassign the values of fields 1, 5, and 6 as being the original values but surrounded by double-quotes. The apparent quoting mess is because I used double-quotes to create the surrounding string, and because the only string I want to print is a double-quote, I have to escape it, so each double-quote that I want ends up being
""". - Once the fields have been updated, print the newly-combined string.
The script is:
awk -F, 'BEGIN OFS=FS $1="""$1"""; $5="""$5"""; $6="""$6"""; print ' < input.csv > output.csv
As you find that you need to quote more fields, simply do the same thing as with fields 1, 5, and 6 above.
add a comment |Â
up vote
1
down vote
With perl
$ perl -F, -lane 'map $_=qq("$_") @F[0,4,5]; print join ",", @F' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-F,use,as input field delimiter, results available in@Farraymap $_=qq("$_") @F[0,4,5]double quote required array elements. Index starts from0. Theqqoperator is used here to avoid escaping double quotes,qq("$_")is same as""$_""print join ",", @Fprint the modified array with,as separator
Another way to do with awk
$ awk -v q='"' 'BEGINsplit("1 5 6",a); FS=OFS=","
for(i in a) $a[i]=q $a[i] q 1' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-v q='"'save double quote as value inqvariablesplit("1 5 6",a)save index to be changed as values inaarray (default split on whitespace, FS is not yet changed)FS=OFS=","change input/output delimiter to,for(i in a) $a[i]=q $a[i] qchange required fields1idiomatic way to print contents of$0
add a comment |Â
up vote
0
down vote
If you really want to use sed (which I don't recommend if awk or perl are available), then assuming that the sixth column is terminated by the line ending rather than a comma AND that fields do not themselves contain embedded (quoted) commas:
sed -E -e 's/([^,]*),/"1",/1' -e 's/([^,]*),/"1",/5' -e 's/([^,]*)$/"1"/' file
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
The general pattern is s/([^,]*),/"1",/n where n refers to the nth occurrence of zero or more non-, characters followed by a , and 1 is a reference to the captured pattern (between parentheses).
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
Using csvtool which has a helpful format command:
csvtool format '"%1",%2,%3,%4,"%5","%6"n' file.csv
Example:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool format '"%1",%2,%3,%4,"%5","%6"n' -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
csvtool also can call shell functions and external programs to parse lines from .CSV files. To do the same thing using printf, but print the "123" in hexadecimal, do:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool call "printf '"%s",%s,%s,%s,"%s","%x"n'" -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","7b"
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
add a comment |Â
up vote
4
down vote
Using csvtool which has a helpful format command:
csvtool format '"%1",%2,%3,%4,"%5","%6"n' file.csv
Example:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool format '"%1",%2,%3,%4,"%5","%6"n' -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
csvtool also can call shell functions and external programs to parse lines from .CSV files. To do the same thing using printf, but print the "123" in hexadecimal, do:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool call "printf '"%s",%s,%s,%s,"%s","%x"n'" -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","7b"
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Using csvtool which has a helpful format command:
csvtool format '"%1",%2,%3,%4,"%5","%6"n' file.csv
Example:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool format '"%1",%2,%3,%4,"%5","%6"n' -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
csvtool also can call shell functions and external programs to parse lines from .CSV files. To do the same thing using printf, but print the "123" in hexadecimal, do:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool call "printf '"%s",%s,%s,%s,"%s","%x"n'" -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","7b"
Using csvtool which has a helpful format command:
csvtool format '"%1",%2,%3,%4,"%5","%6"n' file.csv
Example:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool format '"%1",%2,%3,%4,"%5","%6"n' -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
csvtool also can call shell functions and external programs to parse lines from .CSV files. To do the same thing using printf, but print the "123" in hexadecimal, do:
echo "2018-03-18 4:56:17,255.255.255.255,00,ssh,admin,123" |
csvtool call "printf '"%s",%s,%s,%s,"%s","%x"n'" -
Output:
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","7b"
edited Apr 12 at 6:35
answered Apr 12 at 5:56
agc
4,0091935
4,0091935
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
add a comment |Â
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
+1 this is cool.
â Ã±ÃÂsýù÷
Apr 12 at 6:42
add a comment |Â
up vote
2
down vote
I might approach it with awk this way:
- set the output field separator to what the input field separator is, which we assign as the comma
-F, - for each line, reassign the values of fields 1, 5, and 6 as being the original values but surrounded by double-quotes. The apparent quoting mess is because I used double-quotes to create the surrounding string, and because the only string I want to print is a double-quote, I have to escape it, so each double-quote that I want ends up being
""". - Once the fields have been updated, print the newly-combined string.
The script is:
awk -F, 'BEGIN OFS=FS $1="""$1"""; $5="""$5"""; $6="""$6"""; print ' < input.csv > output.csv
As you find that you need to quote more fields, simply do the same thing as with fields 1, 5, and 6 above.
add a comment |Â
up vote
2
down vote
I might approach it with awk this way:
- set the output field separator to what the input field separator is, which we assign as the comma
-F, - for each line, reassign the values of fields 1, 5, and 6 as being the original values but surrounded by double-quotes. The apparent quoting mess is because I used double-quotes to create the surrounding string, and because the only string I want to print is a double-quote, I have to escape it, so each double-quote that I want ends up being
""". - Once the fields have been updated, print the newly-combined string.
The script is:
awk -F, 'BEGIN OFS=FS $1="""$1"""; $5="""$5"""; $6="""$6"""; print ' < input.csv > output.csv
As you find that you need to quote more fields, simply do the same thing as with fields 1, 5, and 6 above.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
I might approach it with awk this way:
- set the output field separator to what the input field separator is, which we assign as the comma
-F, - for each line, reassign the values of fields 1, 5, and 6 as being the original values but surrounded by double-quotes. The apparent quoting mess is because I used double-quotes to create the surrounding string, and because the only string I want to print is a double-quote, I have to escape it, so each double-quote that I want ends up being
""". - Once the fields have been updated, print the newly-combined string.
The script is:
awk -F, 'BEGIN OFS=FS $1="""$1"""; $5="""$5"""; $6="""$6"""; print ' < input.csv > output.csv
As you find that you need to quote more fields, simply do the same thing as with fields 1, 5, and 6 above.
I might approach it with awk this way:
- set the output field separator to what the input field separator is, which we assign as the comma
-F, - for each line, reassign the values of fields 1, 5, and 6 as being the original values but surrounded by double-quotes. The apparent quoting mess is because I used double-quotes to create the surrounding string, and because the only string I want to print is a double-quote, I have to escape it, so each double-quote that I want ends up being
""". - Once the fields have been updated, print the newly-combined string.
The script is:
awk -F, 'BEGIN OFS=FS $1="""$1"""; $5="""$5"""; $6="""$6"""; print ' < input.csv > output.csv
As you find that you need to quote more fields, simply do the same thing as with fields 1, 5, and 6 above.
answered Apr 12 at 1:10
Jeff Schaller
31.1k846105
31.1k846105
add a comment |Â
add a comment |Â
up vote
1
down vote
With perl
$ perl -F, -lane 'map $_=qq("$_") @F[0,4,5]; print join ",", @F' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-F,use,as input field delimiter, results available in@Farraymap $_=qq("$_") @F[0,4,5]double quote required array elements. Index starts from0. Theqqoperator is used here to avoid escaping double quotes,qq("$_")is same as""$_""print join ",", @Fprint the modified array with,as separator
Another way to do with awk
$ awk -v q='"' 'BEGINsplit("1 5 6",a); FS=OFS=","
for(i in a) $a[i]=q $a[i] q 1' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-v q='"'save double quote as value inqvariablesplit("1 5 6",a)save index to be changed as values inaarray (default split on whitespace, FS is not yet changed)FS=OFS=","change input/output delimiter to,for(i in a) $a[i]=q $a[i] qchange required fields1idiomatic way to print contents of$0
add a comment |Â
up vote
1
down vote
With perl
$ perl -F, -lane 'map $_=qq("$_") @F[0,4,5]; print join ",", @F' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-F,use,as input field delimiter, results available in@Farraymap $_=qq("$_") @F[0,4,5]double quote required array elements. Index starts from0. Theqqoperator is used here to avoid escaping double quotes,qq("$_")is same as""$_""print join ",", @Fprint the modified array with,as separator
Another way to do with awk
$ awk -v q='"' 'BEGINsplit("1 5 6",a); FS=OFS=","
for(i in a) $a[i]=q $a[i] q 1' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-v q='"'save double quote as value inqvariablesplit("1 5 6",a)save index to be changed as values inaarray (default split on whitespace, FS is not yet changed)FS=OFS=","change input/output delimiter to,for(i in a) $a[i]=q $a[i] qchange required fields1idiomatic way to print contents of$0
add a comment |Â
up vote
1
down vote
up vote
1
down vote
With perl
$ perl -F, -lane 'map $_=qq("$_") @F[0,4,5]; print join ",", @F' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-F,use,as input field delimiter, results available in@Farraymap $_=qq("$_") @F[0,4,5]double quote required array elements. Index starts from0. Theqqoperator is used here to avoid escaping double quotes,qq("$_")is same as""$_""print join ",", @Fprint the modified array with,as separator
Another way to do with awk
$ awk -v q='"' 'BEGINsplit("1 5 6",a); FS=OFS=","
for(i in a) $a[i]=q $a[i] q 1' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-v q='"'save double quote as value inqvariablesplit("1 5 6",a)save index to be changed as values inaarray (default split on whitespace, FS is not yet changed)FS=OFS=","change input/output delimiter to,for(i in a) $a[i]=q $a[i] qchange required fields1idiomatic way to print contents of$0
With perl
$ perl -F, -lane 'map $_=qq("$_") @F[0,4,5]; print join ",", @F' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-F,use,as input field delimiter, results available in@Farraymap $_=qq("$_") @F[0,4,5]double quote required array elements. Index starts from0. Theqqoperator is used here to avoid escaping double quotes,qq("$_")is same as""$_""print join ",", @Fprint the modified array with,as separator
Another way to do with awk
$ awk -v q='"' 'BEGINsplit("1 5 6",a); FS=OFS=","
for(i in a) $a[i]=q $a[i] q 1' ip.txt
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
-v q='"'save double quote as value inqvariablesplit("1 5 6",a)save index to be changed as values inaarray (default split on whitespace, FS is not yet changed)FS=OFS=","change input/output delimiter to,for(i in a) $a[i]=q $a[i] qchange required fields1idiomatic way to print contents of$0
edited Apr 12 at 4:23
answered Apr 12 at 4:15
Sundeep
6,9511826
6,9511826
add a comment |Â
add a comment |Â
up vote
0
down vote
If you really want to use sed (which I don't recommend if awk or perl are available), then assuming that the sixth column is terminated by the line ending rather than a comma AND that fields do not themselves contain embedded (quoted) commas:
sed -E -e 's/([^,]*),/"1",/1' -e 's/([^,]*),/"1",/5' -e 's/([^,]*)$/"1"/' file
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
The general pattern is s/([^,]*),/"1",/n where n refers to the nth occurrence of zero or more non-, characters followed by a , and 1 is a reference to the captured pattern (between parentheses).
add a comment |Â
up vote
0
down vote
If you really want to use sed (which I don't recommend if awk or perl are available), then assuming that the sixth column is terminated by the line ending rather than a comma AND that fields do not themselves contain embedded (quoted) commas:
sed -E -e 's/([^,]*),/"1",/1' -e 's/([^,]*),/"1",/5' -e 's/([^,]*)$/"1"/' file
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
The general pattern is s/([^,]*),/"1",/n where n refers to the nth occurrence of zero or more non-, characters followed by a , and 1 is a reference to the captured pattern (between parentheses).
add a comment |Â
up vote
0
down vote
up vote
0
down vote
If you really want to use sed (which I don't recommend if awk or perl are available), then assuming that the sixth column is terminated by the line ending rather than a comma AND that fields do not themselves contain embedded (quoted) commas:
sed -E -e 's/([^,]*),/"1",/1' -e 's/([^,]*),/"1",/5' -e 's/([^,]*)$/"1"/' file
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
The general pattern is s/([^,]*),/"1",/n where n refers to the nth occurrence of zero or more non-, characters followed by a , and 1 is a reference to the captured pattern (between parentheses).
If you really want to use sed (which I don't recommend if awk or perl are available), then assuming that the sixth column is terminated by the line ending rather than a comma AND that fields do not themselves contain embedded (quoted) commas:
sed -E -e 's/([^,]*),/"1",/1' -e 's/([^,]*),/"1",/5' -e 's/([^,]*)$/"1"/' file
"2018-03-18 4:56:17",255.255.255.255,00,ssh,"admin","123"
The general pattern is s/([^,]*),/"1",/n where n refers to the nth occurrence of zero or more non-, characters followed by a , and 1 is a reference to the captured pattern (between parentheses).
answered Apr 12 at 1:15
steeldriver
31.4k34978
31.4k34978
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437164%2fis-it-possible-to-put-double-quotes-in-just-a-few-columns-using-sed%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What trouble did you have with extending a solution for one column?
â muru
Apr 12 at 1:02
What I found generally handles only one column or allplease add those to question.. it will show your research effort..â Sundeep
Apr 12 at 4:07
Is the reason that you need to quote these column that they may contain commas? This matters for most answers written so far.
â Kusalananda
Apr 12 at 6:28
2
To be more precise: If the reason that the fields needs to be quoted is that some of the data in those fields contain commas, then that would invalidate every answer written so far.
â Kusalananda
Apr 12 at 7:24
I agree with Kusalananda. I have to ask: why are you trying to do this? This smells like an XY problem to me.
â glenn jackman
Apr 12 at 14:09