Let`s say that exist 3 txt documents. I need a script that will read all of this documents, and generate a file whith all of this like this.
For example. The 1st file contains :
bot
shell
tcl
The 2nd contains
member
profile
faq
And the 3rd contains
code
search
help
I want that the tcl generate the 4 files that should be like this :
bot:member:code
shell:profile:search
tcl:faq:help
set f1 [open file1]
set f2 [open file2]
set f3 [open file3]
set i 0
while {[gets $f1 1]>0 && [gets $f2 2]>0 && [gets $f3 3]>0} {
set out [open "out[incr i]" w]
puts $out $1:$2:$3
close $out
}
close $f1
close $f2
close $f3
(if you want it all in one file, just move the opening/closing of the output file outside the loop)