line_2_data=Noneline_3_data=Noneline_4_data=Nonewithopen('some_file.txt')asfile:# iterate line by line
forlineinfile:ifthis_line_is_what_i_want(line):line_2_data=extract_data_using_regex_or_split_string(line)elifthis_line_is_what_i_want_too(line):line_3_data=extract_this_data_too(line)...
if index of the line in the file is what you are looking for.
View all comments
Show parent comment
1
u/[deleted] Feb 23 '20
I don't know how to split the notepad file into separate variables for each line