Recorder question

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
yyleno
Posts: 33
Joined: Wed Sep 15, 2010 4:50 am
Location: Shanghai University

Recorder question

Post by yyleno »

Hi,vesna,

I need to write almost 1000 *.txt file in one txt file.
for example,
This is my record in :!: Periods%i.txt :!:
but if I calculate 1000 times,there will have 1000 periods.txt
and now i need only one periods.txt and all 1000 results in it.
FOR EXAMPLE :
T1 T2 T3
1 0.4 0.5
2 3 4
.......

HOW CAN I CHANGE TE CODE BELOW?

set period [format "Periods%i.txt" $k]
set Periods [open $period "w"]
foreach t1 T1=$T1 t2 T2=$T2 t3 T3=$T3 {
puts $Periods " $t1 $t2 $t3 "
}
close $Periods


THANKS
vesna
Posts: 3033
Joined: Tue May 23, 2006 11:23 am
Location: UC Berkeley

Re: Recorder question

Post by vesna »

You can do all in one step. Why do you need 1000 files.

The first time you write it have it like this:

set Periods [open $period "w"]

and every other time you write it have it like this:

set Periods [open $period "a"]
Post Reply