Good afternoon,
I have a question regarding reading from a text file. Suppose that I have a text file that looks like:
10003 343 0.04 1213 ES1(10-1) 3454 34
10024 342 0.93 1212 ES2(9-2) 3452 34 245 34
10032 331 1.44 1880 MT1(7-6) 2323 21 354 111 345
...
...
...
This text file can go up to 100 rows and each of these rows are not necessarily of the same length. What I would like to do is to read the text file, search for the occurrence of a particular phrase (e.g. "ES1" or "MT1"), and then output the row that contains that phrase. I originally attempted to put each line into an array, but since these rows are uneven, this didn't work properly. Any suggestions?
I have a question regarding reading from a text file. Suppose that I have a text file that looks like:
10003 343 0.04 1213 ES1(10-1) 3454 34
10024 342 0.93 1212 ES2(9-2) 3452 34 245 34
10032 331 1.44 1880 MT1(7-6) 2323 21 354 111 345
...
...
...
This text file can go up to 100 rows and each of these rows are not necessarily of the same length. What I would like to do is to read the text file, search for the occurrence of a particular phrase (e.g. "ES1" or "MT1"), and then output the row that contains that phrase. I originally attempted to put each line into an array, but since these rows are uneven, this didn't work properly. Any suggestions?