Jump to content
Macro Express Forums

End Of File Search


pegases
 Share

Recommended Posts

Hi,

 

I am trying to search through a text file till I find a specific name. Is there a way to setup a loop till end of file reading line by line.

 

I know that Text File Begin Process can read a line from the file if the line is specified. And there is a repeat folder command that will load all the files in the folder till end but no such command for a file.

 

Thank you,

 

Pegases

Link to comment
Share on other sites

You can process every line in a text file by using the Text File Begin Process command. You don't need to specify the line, just select 'Process all Records' starting from record 1. Do you what to stop processing the file when you find the name you are looking for? That would be a bit more complicated...

Link to comment
Share on other sites

Do you what to stop processing the file when you find the name you are looking for? That would be a bit more complicated
This could be accomplished using the Break command.
Text File Begin Process: "test.txt"
 If Variable %T1% = "A name"
   Break
 End If
Text File End Process

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...