Hey guys,
Sorry for the basic question but I have a lot of files that I want to separate into groups based on filenames which I can then cat together. Eg I have:
(a_b_c.txt)
WB34_2_SLA8.txt
WB34_1_SLA8.txt
WB34_1_DB10.txt
WB34_2_DB10.txt
WB34_1_SLA8.txt
WB34_2_SLA8.txt
77_1_SLA8.txt
77_1_DB10.txt
77_2_SLA8.txt
77_1_SLA8.txt
....
Im keen on using either find or a simple bash command to separate files into either groups based on either a or c etc, but I can't seem to work out how to specificallt reference a certain part of the filename. Would like to cat together say, [ cat 77_1_SLA8.txt and 77_2_SLA8.txt > 77_SLA8.txt ] (ie. based on the b value).
Any ideas?