Delete "," in the first and last line of a CSV

-1

I have a csv that is exported like this:

+++ Host - Begin +++,,
Name,Description
test1,abc2
test2, abd3
+++ Host - End +++,,

How do I get this result?

+++ Host - Begin +++
Name,Description
test1,abc2
test2, abd3
+++ Host - End +++
    
asked by anonymous 25.10.2017 / 13:23

1 answer

0

Apparently sed would solve this simple example you gave:

sed s/,,//g

Assuming the text format is:

+++ Host - Begin +++,,
Name,Description
test1,abc2
test2,abd3
+++ Host - End +++,,

Removing all "," from the text:

cat meuarquivo.csv | sed s/,,//g
# ou
sed s/,,//g meuarquivo.csv
    
25.10.2017 / 14:56