KeyRoutines
StepFreefile.readText

Read a text file's contents into a routine on Windows

Read text file loads what is written in a text file so later steps can use it. People use it to check a log for a word, show a note on screen, or work through a list one line at a time.

How it works

  • Point it at the text file; it outputs the full text and the lines separately.
  • Files are read as UTF-8 unless the file says it uses a different encoding.
  • An advanced maximum size, 10 MB by default, stops the step with an error rather than pulling a huge file into memory.
  • It only reads, so dry runs behave the same as real runs.

Routines that use it

Search a log

Read a log file, use Find with a pattern to pull out an error line, and Show banner when one turns up.

Speak a reminder

Read a reminders file every morning and have Speak text read it aloud.

Work through a list

Read a file of web addresses and use For each on its lines to open them with Open URLs.

Settings

SettingWhat it does
PathThe text file.
Max sizeadvancedStop with an error when the file is bigger than this.

Good to know

  • Files bigger than the size limit (10 MB unless you change it) stop the step.
  • A cloud "online only" file is not read.

Questions

Can a routine read a file line by line?
Yes. Read text file outputs the lines as a list as well as the whole text, so For each can step through them.
Is there a size limit?
By default it refuses files over 10 MB. You can change that limit in the step's advanced settings.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.