Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shinji

macrumors 65816
Original poster
Mar 18, 2007
1,336
1,518
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.