I'm trying to opn a file to read the infomation. The code is:
set fp [open "Reactions.txt" r]
set file_data [read $fp]
close fp
But in the first line the Opensees gives an error:
wrong # args: should be "set varName ?newValue?"
What this means??
Tanks
Read a file
Moderators: silvia, selimgunay, Moderators
Re: Read a file
If you want to open a file and use the data here is the example:
set fileR [open Reactions.txt "r"]
set line [gets $fileR]
close $fileR
Variable $line will contain the data from the file.
set fileR [open Reactions.txt "r"]
set line [gets $fileR]
close $fileR
Variable $line will contain the data from the file.