title: Tcl: how to print one set
body: <p>My file to be parsed is like this</p>
  
  <pre><code>Name : John
  Pin : 5400
  Age : 40
  Place: Korea
  Amount : 4000
  Name : Peter
  Pin : 6700
  Age : 10
  Place : Japan
  Amount : 3600
  </code></pre>
  
  <p>My tcl code is</p>
  
  <pre><code>set start "Name"
  set pn "Pin"
  set ag "Age"
  set ag_cutoff 15
  set amnt "Amount"
  foreach line [split $content "\n"] {
     if {[regexp $start $line]} {
        set count 1
        set l1 $line
     }
     if {[regexp $pn $line] &amp;&amp; $count ==1} {
         set pin_val [lindex $line 2]
         set l2 $line
     }
     if {[regexp $ag $line] &amp;&amp; $count ==1} {
        set ag [lindex $line 2]
        if { $ag &gt; $ag_cutoff} {
            set rep_taken 1
            set l3 $line
        }
        if {[regexp $amnt $line] &amp;&amp; $count ==1 &amp;&amp; $rep_taken == 1} {
            set age_val [lindex $line 2]
            puts $op1 "$ag $age_val "
            puts $op2 "$l1\n$l2\n$l3\n"
        }
  </code></pre>
  
  <p>This code is fine for plots.</p>
  
  <p>However, I also want to o/p a file with complete set where $ag>$ag_cutoff.
  Now with puts $op3 "$l1\n$l2\n$l3\n" ---> Able to print to a file. But how to print line Place which is not evaluated. Any better way to accomplish this.</p>
  
  <pre>
  Name : John
  Pin : 5400
  Age : 40
  Place : Korea
  Amount : 4000
  </pre>