Read a file with the load of a model in it

User: "FaForno"
Altair Community Member
Updated by unknown

Dear All,

I have a file txt with the load that I need to apply to my model.

I would like to read it and assign, thru a routine, to my model (I know the  point where I want apply each load).

I wrote the following code to read the txt file:

 

set fp [open "C:/Load.txt" r]
set file_data [read $fp]
close $fp
#  Process data file
set data [split $file_data "\n"]
foreach line $data {
  # I don't know how write here the list of variable
# one variable for each line of .txt file
 
}

Can someone help me?

 

thanks a lot in advance.

 

Fabio

Find more posts tagged with