Alright. I have a large amount of text I need to process in a couple of ways.
It all starts with 1 big text file, formatted kinda like this:
Sometimes the folders have more than 4 items, sometimes less - but the key thing is there is a return between them. There is also some junk that may need to be filtered out, but the first part, the /directory, will not be part of the junk.
I need a script/workflow to separate these into separate text files (based on the returns between the sections) and name each file something like 'file1' 'file2' 'file3' etc.
STEP 2: (Maybe part of step 1?)
I now need to take these files, and count how many lines are in each, and set the name accordingly: If there were 11 lines in file1, then it would name it: "file1(11)"
STEP 3:
Now, it takes one of these files (for example, file1(11)), and copies line 1 (without the return), and pastes it in place of "COMMAND 1" in another text file named something similar, like "file1(11).different extension). It then takes line 2, and replaces COMMAND 2, line 3 replaces COMMAND 3, etc, etc, etc.
STEP 4: (Maybe part of step 3?)
It takes the name of part of one of the lines:
directory/folder1/NAME1
So, the "NAME1" part, and replaces "ECHO1" with "NAME1". The "ECHO1" will be in the same file as COMMAND 1, COMMAND 2, and COMMAND 3.
Occasionally, there will be some stuff after name 1, but it will be separated by a comma - directory/folder1/NAME1,blah blah blah - but I still only want the NAME1 part.
How possible is this? I don't care if it takes a bunch of files/workflows, but there's so much info I have to go through that doing it manually is out of the question.
It all starts with 1 big text file, formatted kinda like this:
Code:
directory/folder1/name1
directory/folder1/name2
directory/folder1/name3
directory/folder1/name4
directory/folder2/name5
directory/folder2/name6
directory/folder2/name7
directory/folder2/name8
directory/folder3/name9
directory/folder3/name10
directory/folder3/name11
directory/folder3/name12
Sometimes the folders have more than 4 items, sometimes less - but the key thing is there is a return between them. There is also some junk that may need to be filtered out, but the first part, the /directory, will not be part of the junk.
I need a script/workflow to separate these into separate text files (based on the returns between the sections) and name each file something like 'file1' 'file2' 'file3' etc.
STEP 2: (Maybe part of step 1?)
I now need to take these files, and count how many lines are in each, and set the name accordingly: If there were 11 lines in file1, then it would name it: "file1(11)"
STEP 3:
Now, it takes one of these files (for example, file1(11)), and copies line 1 (without the return), and pastes it in place of "COMMAND 1" in another text file named something similar, like "file1(11).different extension). It then takes line 2, and replaces COMMAND 2, line 3 replaces COMMAND 3, etc, etc, etc.
STEP 4: (Maybe part of step 3?)
It takes the name of part of one of the lines:
directory/folder1/NAME1
So, the "NAME1" part, and replaces "ECHO1" with "NAME1". The "ECHO1" will be in the same file as COMMAND 1, COMMAND 2, and COMMAND 3.
Occasionally, there will be some stuff after name 1, but it will be separated by a comma - directory/folder1/NAME1,blah blah blah - but I still only want the NAME1 part.
How possible is this? I don't care if it takes a bunch of files/workflows, but there's so much info I have to go through that doing it manually is out of the question.