I am parsing a very large csv file and creating many sub-files with its contents according to the value of the first column. So far, what I have done is manually declare an array:declare -a arr=(Value 1Value 2)and then I loop through this array and create the mini-csv files with the information I care about, also changing the name of the output csv files to swap spaces with underscores:for i in ${arr[@]}do     NAME=${i// /_}    echo $header > $outputpath/$NAME.csv    grep ^$i, $fixed_file | cut -d ',' -f 4,6 >> $outputpath/$NAME.csvdoneIs there a way to automate the first step as well? i.e., Can I loop through the original csv file and populate arr with all unique values of its column 1?
Loop through csv file and save all unique elements of a column into an array
bash;shell;awk
One way:declare -A arrwhile IFS=, read -r one restdo  arr[$one]=1done < input.csvThen loop over the keys:for i in ${!arr[@]}do  #...done