Hi Dewey
This line give a syntax error. I dont know TK script at all so I dont 
know where to start looking for this.

   set ::files($::idx,name) "$f"



On 2014-02-12 15:51, Dewey Garrett wrote:
> A script to combine multiple 'section' files (.sec)
> to a single output file (.ini for example) follows
>
> Usage:
>
> # paste the text below to a file named combine.tk in a
> # directory containing one for more 'section' files named *.sec
> # cd to that directory
> # (if a output file name is reused, one backup copy is saved (.old))
>
> $ chmod +x combine.tk # make it executable
> $ ./combine.tk &
>
>
> #---------------------------------- begin combine.tk
> #!/usr/bin/env wish
>
> set out_suffix .ini
> set in_suffix .sec
>
> set ::idx 0
> foreach f [lsort [glob *$in_suffix]] {
>    set ::files($::idx,name) "$f"
>    pack [checkbutton .f$::idx -text $f -variable ::files($::idx,use)] -anchor 
> w
>    incr ::idx
> }
> pack [label .newname -text NewName:] -anchor w
> set ::ename "ini_name$out_suffix"
> pack [entry .e -textvariable ::ename]
>
> pack [button .create -text Create -command combine] -expand 1 -fill x
> pack [button .dismiss -text Exit -command exit] -expand 1 -fill x
>
> proc popup {msg} {
>     tk_messageBox -title "$::argv0" -type ok -message "$msg"
> }
>
> proc combine {} {
>    set msg ""
>    if {"$::ename" == ""} {
>      set msg "Cannot use blank file name"
>      popup $msg
>      return
>    }
>    if [file exists $::ename] {
>      file rename -force $::ename ${::ename}.old
>      set msg "$msg\nSaved: ${::ename}.old\n"
>    }
>    set ct 0
>    for {set i 0} {$i < $::idx} {incr i} {
>      if $::files($i,use) {
>        set msg "$msg\nAdd: $::files($i,name) to $::ename"
>        exec cat $::files($i,name) >> $::ename
>        incr ct
>      }
>    }
>    if $ct {
>      set msg "$msg\n\nCreated $::ename"
>    } else {
>      set msg "$msg\nNo files selected"
>    }
>    popup $msg
>    return
> }
> #---------------------------------- end combine.tk

-- 

Regards /Groete

Marius D. Liebenberg
+27 82 698 3251
+27 12 743 6064


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to