Skip to main content
Post Closed as "Duplicate" by countermode, techraf, GAD3R, HalosGhost, sam
added 6 characters in body
Source Link
joker21
  • 241
  • 1
  • 3
  • 8

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}",1

3,4,"{3,9,1}",2

8,9,"{10,12,30}",3

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}"

3,4,"{3,9,1}"

8,9,"{10,12,30}"

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}",1

3,4,"{3,9,1}",2

8,9,"{10,12,30}",3

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

added 34 characters in body
Source Link
jcbermu
  • 4.9k
  • 19
  • 27

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}"

3,4,"{3,9,1}"

input.csv

8,9,"{10,12,30}"

1,2,"{1,2,3}"

3,4,"{3,9,1}"

8,9,"{10,12,30}"

I want the output as

output.csv

1,2,3

3,9,1

output.csv

10,12,30

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}"

3,4,"{3,9,1}"

8,9,"{10,12,30}"

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}"

3,4,"{3,9,1}"

8,9,"{10,12,30}"

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.

Source Link
joker21
  • 241
  • 1
  • 3
  • 8

cut an array column in csv

I want to cut an array column in a CSV file. For example if you see the below CSV file

input.csv

1,2,"{1,2,3}"

3,4,"{3,9,1}"

8,9,"{10,12,30}"

I want the output as

output.csv

1,2,3

3,9,1

10,12,30

I tried using cut -d , -f 3 input.csv and cut -d { -f 3 input.csv but both did not work .Any help is appreciated.Thanks in advance.