Station AcademyActivity referenceRPAi StationConsultingAurora Academy
Academy/Station Academy/Level 4/Reading and writing text files
Level 4 · Working with data

Reading and writing text files

Read a text file into a variable, write or append text, and choose the right encoding.

Intermediate≈ 12 min (estimate)Windows, macOSSource-verified
Before this lesson
Files and folders
You will learn to
  • Read a file with Read File
  • Overwrite or append with Write File
  • Build a simple log file

Read File

Read File: File Path, Encoding (utf-8, ascii, utf-16) and Save To Variable. The whole file becomes one text value. Use String Operation split with the line break to get a list of lines, or Regex to pick out parts.

Write File

Write File: File Path, Content and Mode.

  • overwrite replaces the file (or creates it).
  • append adds to the end, which is perfect for a simple log.

Content can contain variables: Processed {{count}} files at {{time}}.

A run log in three steps

  1. Now → now.
  2. Format Date now, format YYYY-MM-DD HH:mm → time.
  3. Write File {{folder}}/run-log.txt, mode append, content {{time}} finished.

Run it twice and open run-log.txt: there are two lines.

Activities in this lesson

Read File · Write File · Now · Format Date

Saved only in this browser.

Source-verified. Steps were checked against the Station source code and authentic screenshots. Not yet executed step by step in the app. Written against RPAi Station for macOS 0.1.0 (1) (RPAi_Station_2.0 @ port/macos 9864e96) and the Windows source (RPAi_Station_2.0 @ codex/native-station e68f16d). Reviewed 2026-11-30. UI labels may differ slightly in other versions; see versions and changes.