Using Awk to split files
Created on 2022-10-06T07:43:12-05:00
# send each line to a file named after the value of the second column
awk -F, '{ print > $2 ".csv" }' file.csv
# only split when the second field has one of a set value
awk -F, '$2 == "577" || $2 == "132" { print > $2 ".csv" }' file.csv