- #1
deltapapazulu
- 84
- 12
How do I use Python to extract all text that comes between a recurring set of unique strings? Example:
ABC;the red dragon;123,
ABC;the blue dragons;123
ABC;the black dwarf;123,
ABC;the gray elves;123
ABC;fantasy characters;123,
ABC;winged balrogs;123
I want to parse through a large text file that has certain non-repeating text that comes between repeating text and write each instance of this into a CSV file in a long column. The program would also create the CSV file. It would open a text file, get stuff from it, create CSV file and write stuff into it.
The end result would look like this in the CSV file.
the red dragon
the blue dragons
the black dwarf
the gray elves
fantasy characters
winged balrogs
ABC;the red dragon;123,
ABC;the blue dragons;123
ABC;the black dwarf;123,
ABC;the gray elves;123
ABC;fantasy characters;123,
ABC;winged balrogs;123
I want to parse through a large text file that has certain non-repeating text that comes between repeating text and write each instance of this into a CSV file in a long column. The program would also create the CSV file. It would open a text file, get stuff from it, create CSV file and write stuff into it.
The end result would look like this in the CSV file.
the red dragon
the blue dragons
the black dwarf
the gray elves
fantasy characters
winged balrogs