title: TCL- script to output a file which contains size of all the files in the directry and subdirectories
body: <p>Please help me with the script which outputs the file that contains names of the files in subdirectories and its memory in bytes,  the arguement to the program is the folder path .output file should be file name in 1st column and its memory in second column</p>
  
  <p>Note:folder contains subfolders...inside subfolders there are files</p>
  
  <p>.I tried this way </p>
  
  <pre><code>set fp [open files_memory.txt w]
  set file_names [glob ../design_data/*/*]
  foreach file $file_names {
          puts $fp "$file    [lindex [exec du -sh $file] 0]"
  }
  close $fp
  </code></pre>
  
  <p>Result sample:</p>
  
  <pre><code>../design_data/def/ip2.def.gz    170M
  ../design_data/lef/tsmc13_10_5d.lef      7.1M
  </code></pre>
  
  <p>But i want only file name to be printed that is ip2.def.gz , tsmc13_10_5d.lef ..etc(not the entirepath) and file memorry should be aligned</p>
  
  <p>TCL</p>