Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
btpoole
Channel Surfer

Search Text File For String

I am needing to search a text file and paras a line of text but have been unsuccessful. I have read the sdk for using the different methods like left, right, mid and even the ifRegex but with no positive results. I know the particular string of text but the location in the text file may vary. The text file could contain up to 130 lines. Once I am able to find the particular string I could use the left, right to extract the desired string. Can somebody tell me the easiest way to search the file for string.
Thanks for any help

The file is a tmp file on the roku.
0 Kudos
2 REPLIES 2
EnTerr
Roku Guru

Re: Search Text File For String

BrightScript Debugger> ? inStr(1, "some really big string coming from a file perhaps", "ring")
19

See 8.5 Instr(start as Integer, text as String, substring as String) as Integer
Also 7.7 ReadAsciiFile(filepath as String) as String
0 Kudos
btpoole
Channel Surfer

Re: Search Text File For String

Thanks, was able to locate string with your help using instr.
0 Kudos