From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Nov 03 2005 - 16:43:59 CST

Hi,
  You can just change the 'puts' command to something like this:
    set foo [expr cos($i) + 3.0]
    puts $f "my foo: $foo $idx"

  John

On Thu, Nov 03, 2005 at 05:21:15PM -0500, VISWANADHA SRIDHARA wrote:
> Hi everyone ,
> John sent me this code few days back, and Its running absolutely well for
> me to analyze some data.
>
> set f [open "foo.dat" w]
> set sel [atomselect top "water and exwithin 3 of protein"]
> set residlist [lsort -unique -integer [$sel get resid]]
> foreach idx $residlist {
> puts $f "$idx"
> }
> close $f
>
>
> I have one quick question.
>
> I want to write some text in the first line of this foo.dat file, before I
> save the residue numbers....
> e.g., my foo.dat now is a column having integers, I want to add a
> line(characters like...
> [A[expr $i]] before I store a column, I know its very simple question, but
> I am just not familiar with these kind of languages.......Can anyone tell
> me how to do it?
>
> Thanks in advance ....
> Vissu

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078