| Name | createReader() | ||
|---|---|---|---|
| Examples | 
def setup():
    global reader
    #Create the global buffered reader object
    reader = createReader("positions.txt")
    
def draw():
    try:
        line = reader.readLine()
    except:
        line = None
    
    if (line == None):
        #Stop reading, because of an error or the file is empty
        noLoop()
    else:
        #Split eace line on a tab. 
        positions = line.split("\t")
        x = int(positions[0])
        y = int(positions[1])
        point(x,y)
THIS EXAMPLE IS BROKEN | ||
| Description | Creates a BufferedReader object that can be used to read files line-by-line as individual String objects. This is the complement to the createWriter() function. Starting with Processing release 0134, all files loaded and saved by the Processing API use UTF-8 encoding. In previous releases, the default encoding for your platform was used, which causes problems when files are moved to other platforms. | ||
| Syntax | createReader(filename) | ||
| Parameters | 
 | ||
| Related | createWriter() | 
Updated on Tue Feb 27 14:07:12 2024.
If you see any errors or have comments, please let us know.
 
                    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License