Return the line following another line in a text file

(imported topic written by bbishop91)

I’m creating an analysis that reads a text file and returns one line of that text file assuming the line before it meets a conditional.

For instance, in the example text below, how would I return a line, but only if the preceding line contains “ToastEnabled”? Unfortunately, this file isn’t the same for everyone and the line numbers vary.

In this case, my desired output would be " False"

0,0,0

False

True

SkyBlue

Thanks in advance!

(imported comment written by BenKus)

Hey bbishop,

You could do XML parsing, but the example is simple enough that you can do something like this:

q: (next line of lines whose (it contains “ToastEnabled”) of file “C:\temp\test.txt”) as trimmed string
A: False

Ben

(imported comment written by bbishop91)

Worked great. Thanks!