I have a TXT file with over 500.000 lines of text that needs to be structured in a "pyramid" like style.
The script must run on a Windows XP machine and go through the list and read the first line. I call this the Level 1 text. Nothing happens with this line, it's only copied and saved into a separate txt file.
Then the script must read the next 10 lines and append the value of the level 1 line at the end of each of these lines with a prefix and a suffix. I call these the Level 2 texts and I must be able to tell the script what the level 2 prefix and suffix is (only strings)
Then the script must proceed and get the first Level 2 text and append it to the next 10 unprocessed lines, again with a prefix and suffix. These become Level 3 texts.
Then the script must proceed and get the second Level 2 text and append it to the next 10 unprocessed lines, again with the same prefix and suffix. These also become Level 3 texts.
And so on untill all 10 Level 2 texts are appended and I have 10 Level 3 sets.
And finally there must also be a Level 4 where each set also contains of 10 lines appended by a level 3 text (with prefix and suffix).
It doesn't matter what programming language you create this in, as long as I am able to enter the list, set some values for prefix and suffix and then the script must produce txt files for each Level.
It must continue untill all 4 levels are full and it must delete the processed lines from the input file. Then I am able to restart the entire process with what's left in the original inputfile with a different prefix and suffix.
Level 1 - one line
Level 2 - 10 lines and each line is appended by level 1 value
Level 3 - 10 lines appended with the 1st level 2 value
Level 3 - 10 lines appended with the 2nd level 2 value
and so on...