Splitting CSV files with the cut command
This script which uses the cut command will split the lines on commas and print the 3rd column:
echo "1, 2, 3, 4\n5, 6, 7, 8" | cut -d "," -f 3
=> 3
=> 7
This script which uses the cut command will split the lines on commas and print the 3rd column:
echo "1, 2, 3, 4\n5, 6, 7, 8" | cut -d "," -f 3
=> 3
=> 7