I have a directory of CSV files like:
modfinalak_1.csv
modfinalal_1.csv
modfinalal_2.csv
modfinalar_1.csv
and so on for all 50 states (AK, AL, AR, etc.), with varying number of files per state. Is there a way to combine all files with the same text before the '_' character? I tried doing this with the unix cat command, but I'm lost as to how I tell it rename each combined file after that.
modfinalak_1.csv
modfinalal_1.csv
modfinalal_2.csv
modfinalar_1.csv
and so on for all 50 states (AK, AL, AR, etc.), with varying number of files per state. Is there a way to combine all files with the same text before the '_' character? I tried doing this with the unix cat command, but I'm lost as to how I tell it rename each combined file after that.