Skip to main content

Read File

Command description

Read a text file, such as a .txt file.

Command Input Parameters

input parametersInput parameter typeDescription
File PathstrFull path of the file to read, for example C:\xx
FormatenumAuto, utf-8, gb18030, gbk, gb2312, utf-16, big-5, utf-8-sig, utf-16-le, utf-16-be

Command Output Parameters

Output parametersOutput parameter typeDescription
ContentstrRead file content

Edge Cases

  • The command reports an error if File Path does not exist, points to a folder, or cannot be opened as text.
  • Auto and an empty Format value detect the encoding automatically. Selecting the wrong encoding may cause a decoding error.
  • This command reads in text mode and is not suitable for binary files such as images or archives.