Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python read file between two strings

inRecordingMode = False
for line in file:
    if not inRecordingMode:
        if line.startswith('<START>'):
            inRecordingMode = True
    elif line.startswith('<END>'):
        inRecordingMode = False
    else:
        yield line
Source by sopython.com #
 
PREVIOUS NEXT
Tagged: #python #read #file #strings
ADD COMMENT
Topic
Name
1+1 =