Splitting a text file into seperate text files.
Posted on 2001-06-26
I get a text file with a long list of filenames that looks like this:
I need to be able to send all the files with CH-A-00 to one file and CH-A-06 to another and CH-A-08 to another and so on. The number in the 13th and 14th position determines what file they need to go. I can't grep those positions because they change and I never know what they're going to be. The letters in front of those postions change to.
Is there a way to cut that number out and save it to a variable then use the variable in a for loop or if statement then goto the next line?