Fetching text from a file

Hi,

I want to print specific text between substring from a specific file’s line but dont know how to write it. please help.

Here’s an example -

preceding text of first “test” of following text of first “test1” of lines of file “c:\temp\mytestfile.txt”

didnt get it, suppose i have file under c:/text.txt which contain Hello my name is “Vijay”, then how to print only Vijay, please explain I am not good in scripting :slight_smile:

In your example create a file “c:\temp\mytestfile.txt” containing hello my name is vijay

q: lines of file "c:\temp\mytestfile.txt"
A: hello my name is vijay
T: 0.583 ms

q: following text of first "hello my name is " of lines of file "c:\temp\mytestfile.txt"
A: vijay
T: 0.513 ms

Or with hello my name is “vijay”,
q: preceding text of first “,” of following text of first "hello my name is " of lines of file "c:\temp\mytestfile.txt"
A: "vijay"
T: 0.523 ms

q: preceding text of first “%22” of following text of first “hello my name is %22” of lines of file "c:\temp\mytestfile.txt"
A: vijay
T: 1.035 ms

1 Like

@nicksberger thank you so much :slight_smile:

substring between “%22” of lines whose (it starts with “hello my name is”) of file “c:\temp\mytestfile.txt”

if you know that that the line will always start with that, and you will always have a quoted answer.

-c

1 Like