I have a large amount of data formatted like this:
value1,value2,value3
value1,value2,value3
value1,value2,value3
etc..
I want to know how to pull only value2 from every row and output that result. I'm assuming I would use awk in some way?
I have a large amount of data formatted like this:
value1,value2,value3
value1,value2,value3
value1,value2,value3
etc..
I want to know how to pull only value2 from every row and output that result. I'm assuming I would use awk in some way?
You can use awk:
awk -F, '{print $2}' file
or cut:
cut -d, -f2 file
or csvcut
csvcut -H -c 2 f | tail -n+2
csvcut has the benefit that it also works if you have the delimiter inside the values, e.g.: value1,"value2,3",value4.