Text read and write example

Example script showing how to read and write text files

This script illustrates file handling: create, open, append, read, write.

In this example. the text file “hello_world.txt” is called and the contents are printed to the dialogue box. The script demonstrates how to: (1) read and skip the first line, and (2) read all the lines in a loop.

The user can also write the file locally to the script directory by clicking ‘Yes’ in the pop-up dialogue box, which will write the text file ‘bye_world.txt’.