f



How to write tcl generated xml file into a new file

Hi,

I have generated a xml file using xmlgen.
After running the tcl script the ouput is displayed on the terminal .
I want to take the terminal output into a xml file.

Any Suggestion ???/


Thanks
Ranjan
0
11/25/2008 11:46:48 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

1 Replies
910 Views

Similar Articles

[PageSpeed] 30

On Nov 25, 12:46=A0pm, gyana behera <ranjan....@gmail.com> wrote:
> Hi,
>
> I have generated a xml file using xmlgen.
> After running the tcl script the ouput is displayed on the terminal .
> I want to take the terminal output into a xml file.
>
> Any Suggestion ???/
>
> Thanks
> Ranjan

Either redirect the output of the script to the xml-file. (xmlgen >
output.xml) or open the file in the script:

set f [open $filename w]

then use puts $f instead of puts to output to the file and finally
close the file:

close $f

Note that all this is covered in the Tcl tutorial, which is definitely
worth a visit. (http://www.tcl.tk/man/tcl8.5/tutorial/
tcltutorial.html)

Mark
0
mpc.janssen (384)
11/25/2008 12:03:27 PM
Reply:

Similar Artilces:

Sourcing a TCL file from within a tcl file
I am a newbie which I am sure I don't need to state :) I am trying to create a variable with a TCL file that will source another tcl file when I type the variable name something like this if I enter A through my keyboard then source a.tcl Can someone show me how to do this thanks guy On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > I am a newbie which I am sure I don't need to state :) > > I am trying to create a variable with a TCL file that will source > another tcl file when I type the variable name > > something like this > > if I enter A through my keyboard =A0then source a.tcl > > Can someone show me how to do this > > thanks > guy What you are asking is not hard. Will your program have a graphical user interface? Aric On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote: > On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > > > I am a newbie which I am sure I don't need to state :) > > > I am trying to create a variable with a TCL file that will source > > another tcl file when I type the variable name > > > something like this > > > if I enter A through my keyboard =A0then source a.tcl > > > Can someone show me how to do this > > > thanks > > guy > > What you are asking is not hard. =A0Will your program have a graphical > user interface? > > Aric no I am just using this script...

TCL/PHP/XML problem: I need to convert an XML file into a TCL list
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: [TCL] set contents [read $fileID [file size ${fileName}.xml]]; close $fileID if {![string equal $switch -body]} { # ONLY DO THIS IF THE XML CONTENTS CONTAIN NO BODY - WILL UPGRADE AT A LATER DATE 11/24/2006 - PHIL global serverName if {![info exists serverName]} { global env source ./cgi_globals.tcl global serverName } if {[string length [info procs {URL_ENCODE}]] == 0} { source...

write file + input file + write file
Hi, I want to write some latex command to a file (file1), input the file at the end of the document. These command shall write to another file (file2) and at a second run I use the file2. Whatever I have tried nothing works and I don't known why. The goal is to save a set of special commands and run them at the end of the document, because they use some values which are only available at the end! Can anybody please help me with that? Thanks in advance! I should be something like: \begin{document} \usepackage{style} \input{file2} %file exists from a previous run \end{document} style.sty: \newwrite\fileone \openout\fileone=file1.out \newwrite\filetwo \openout\filetwo=file2.out \newcommand{\writetofiletwo}[1]{% \write\filetwo{#1}% } \newcommand{\writetofileone}[1]{% \write\fileone{\writetofiletwo{some text}}% } \AtEndDocument{\closeout\fileone% \input{file1}% \closeout\filetwo% } Problem solved :-) \immediate\closeout before \input was required. greenux wrote: > Hi, > I want to write some latex command to a file (file1), input the file > at the end of the document. These command shall write to another file > (file2) and at a second run I use the file2. > Whatever I have tried nothing works and I don't known why. The goal is > to save a set of special commands and run them at the end of the > document, because they use some values which are only available at the > end! > Can anybody please help me with that? > Thanks in advance! &...

Tcl file from .txt file
Hi, I have a excel file. I need to change the excel file in to tcl file. I did = change the excel file in to txt file. but unable to change the txt file in = to tcl file. let me know any idea to change the txt file in to tcl file or = directly from the excel file in to tcl file.=20 your help is much more appreciated. thank you. On 11/14/14, 1:30 PM, yenilsuwal@gmail.com wrote: > Hi, > > I have a excel file. I need to change the excel file in to tcl file. I did change the excel file in to txt file. but unable to change the txt file in to tcl file. let me know any idea to c...

writing new password to new file from old file
Dear all, password.fil has only one column and my customer wants to update the password of users based upon dates validations . Please help me to read in sequential order from password.fil if date is old that value of datevar. Thanks #!/usr/bin/nawk -f if ($1 < datevar) { getline password < "password.fil" print $1 + $2 + password > newfile } else print $1 + $2 + password > newfile On Jan 23, 6:47=A0am, happytoday <ehabaziz2...@gmail.com> wrote: > Dear all, > password.fil has only one column and my customer wants to update the > password of users > b...

Komodo: Accessing widgets in the auto generated _ui.tcl from the associated .tcl file
I am using Komodo. I created a text widget and want to insert some text into it. The below is my ui.tcl file (ie. Dialog_ui.tcl). In my Dialog.tcl file I want to have access to the $base._text_log widget, so I can insert text into it. For eg. I've tried: ::Dialog::._text_log insert end "hello world!" And other variations, but have not succeeded. This seems to be something trivial, but I can't seem to figure it out. I also tried to get to the BASE variable, but was also unsuccessful. I guess my understanding of namespaces isn't correct. Is it even possible? Help is...

new bie question about writing excel file with tcl script?
Hi Members, i need some procedures and suggestions regarding,writing excel format file with tcl. what i am trying to do is read multiple files of .txt format of specific name in directory and trying to compare the data in each file with other data and display the results in the form of tables . is there any tcl example scripts that writes excel format, are available? can any one give me some suggestions regarding,how to search for specific file and to write an excel format with tcl. thanks In article <83ef457f-b378-4e86-bcf2-cfb3678c1300@e25g2000prg.googlegroups.com>, raaki <hemanth004@gmail.com> wrote: >Hi Members, > >i need some procedures and suggestions regarding,writing excel format >file with tcl. > >what i am trying to do is read multiple files of .txt format of >specific name in directory and trying to compare the data in each file >with other data and display the results in the form of tables . > >is there any tcl example scripts that writes excel format, are >available? > >can any one give me some suggestions regarding,how to search for >specific file and to write an excel format with tcl. . . . I do a lot of this: <URL: http://wiki.tcl.tk/excel >. On Dec 4, 2:29 pm, cla...@lairds.us (Cameron Laird) wrote: > In article <83ef457f-b378-4e86-bcf2-cfb3678c1...@e25g2000prg.googlegroups.com>,raaki <hemanth...@gmail.com> wrote: > >Hi Members, > > >i need some pr...

appending a new xml file to another existing xml file
Hei, I am having issue using DOM to appending a new xml file (new.xml) to another existing xml file (old.xml) without deleting the existing items in old.xml. I would like to have the new <items> append at the end of existing items at the old.xml. How can I do that? I am using php5 Thanks! Ofuuzo On Feb 18, 9:30 am, ofuu...@yahoo.no wrote: > Hei, > I am having issue using DOM to appending a new xml file (new.xml) to > another existing xml file (old.xml) without deleting the existing > items in old.xml. I would like to have the new <items> append at the > end of e...

Program to open a file in binary, skip X bytes and write the rest of the file to a new file
How would I approach this? I cannot store the entire file in memory (they are 30GB+) but I need to skip the first 292 bytes and write the rest to a new file. Thanks, Scott scad wrote: > How would I approach this? I cannot store the entire file in memory > (they are 30GB+) but I need to skip the first 292 bytes and write the > rest to a new file. 1. Open the file to read (file_1) 1.a If file_1 in bad state, report and exit. 2. Counter = number of bytes to skip 3. While counter > 0 and not the end of file_1 read file_1 3.a. If file_1 in bad sta...

read an XML file in TCL
Hello I am looking to read an XML file into my TCL program and extract information. How do we read an XML file in TCL? Are there man pages that describe these? Thanks krithiga one way is: http://wiki.tcl.tk/tdom another (and faster, but should be used only for valid stuff) is http://wiki.tcl.tk/11020 Torsten Edler wrote: > another (and faster, but should be used only for valid stuff) is > I'm curious as to this assertion that the shallow regexp parser is faster than tdom, I would have expected things to be the other way around. Do you have a benchmark? Were you testing...

Comparing 2 files and writing diffirence to new file
Hi all I've got two files namely: FileOld FileNew I want to loop through FILEOLD and compare the records with the records in FILENEW. The records that is in FILEOLD and not in FILENEW I want to write to a new file called NEWFILE. My code looks like this but does not give me the correct results: OPEN(FILEOLD) OPEN(FILENEW) CLOSE(NEWFILE) EMPTY(NEWFILE) CREATE(NEWFILE) OPEN(NEWFILE) CLEAR(FILO:RECORD) CLEAR(FILN:RECORD) SET(FILO:SURNAME_KEY,FILO:SURNAME_KEY) SET(FILN:SURNAME_KEY,FILO:SURNAME_KEY) LOOP UNTIL EOF(FILEOLD) NEXT(FILEOLD) NEXT(FILENEW) TEMPSURNAME = FILO:SURNAME ...

Dose there any tcl script to translate an file with embedded tcl
Hi I need to generate some big file, but there are rules for generate these files Ex . ============================== Start input a [0] wire input a [1] wire .. .. .. .. input a [1000] wire End ================================= Dose there any tcl script can help to translate a file with embedded tcl script into a new file For example this is a source file ======================== Start * set i 0 * for { set i 0 } { $i < 1000 } { incr i } { * puts input a [$i] wire * } End ========================== After Translate ======================= Start input a [0] wire input a [1] wire .. .. ...

"no such file or directory" when executing tcl file
Hi, new to TCL and hitting a road bump right out the gate. I just installed ActiveTcl 8.5 on my Windows XP SP2 machine. I made the following script and saved it as test.tcl: #!/usr/local/bin/tclsh puts stdout {Hello, Patrick!} When in the TCL command prompt, I type test.tcl and it gives me the error "couldn't execute ".\test.tcl": no such file or directory". I am in the correct directory so I'm pretty lost as to why it is saying this. Here are my exact steps: <open command prompt> H:\workspaces\tcl>tclsh85 % dir Volume in drive H is Data Volume Serial Number is 828C-6076 Directory of H:\workspaces\tcl 01/12/2009 05:23 PM <DIR> . 01/12/2009 05:23 PM <DIR> .. 01/12/2009 05:37 PM 31 test.tcl 1 File(s) 31 bytes 2 Dir(s) 41,173,749,760 bytes free % test.tcl couldn't execute ".\test.tcl": no such file or directory If someone could help fill in the blanks here, I'd appreciate it. Apparently I'm overlooking something obvious. Thanks, Patrick On Jan 13, 12:43=A0am, "Patrick H." <patri...@gmail.com> wrote: > Hi, new to TCL and hitting a road bump right out the gate. I just > installed ActiveTcl 8.5 on my Windows XP SP2 machine. I made the > following script and saved it as test.tcl: > > #!/usr/local/bin/tclsh > puts stdout {Hello, Patrick!} > > When in the TCL command prompt, I type...

Generating Excel Files w/ TCL
Hy, what packaged will generate Microsoft Excel .xls Files with TCL. I used SpreadSheet 1.1 from GreyTrout Software which is quite good, but to expensive for my appl. Regards TAB Please send eMail on Reply In article <bk6qg4$q6vns$1@ID-95191.news.uni-berlin.de>, Tillmann Basien <tab@basien.de> wrote: >Hy, >what packaged will generate Microsoft Excel .xls Files with TCL. . . . Start with <URL: http://wiki.tcl.tk/excel >. -- Cameron Laird <Cameron@Lairds.com> Business: http://www.Phaseit.net Personal: http://phaseit.net/claird/home.html ...

write binary file with struct in tcl
I have the following in C and I would like to create user interface in tcl/tk for let user append new rule or edit the chkr2k3.dat Please anybody give me the advice how I can do it in Tcl/Tk ? struct rec { int datatype; char data_name[5]; char data[80]; }; typedef struct rec r; FILE *f; int main() { r chkrules; f = fopen("chkr2r3.dat","wb"); chkrules.datatype = 1; strcpy(chkrules.data_name,"cmd"); strcpy(chkrules.data,"cmd1"); fwrite(&chkrules,sizeof(chkrules),1,f); chkrules.datatype = 2; strcpy(chkrules.data_name,"pat...

Newbie help: File searching and writing output to new file
Hi people, I've done a bit of searching through this group, and found some things that I thought would help me, but unfortunately they haven't. I'm just trying to write a short script that will search through web server log files and write out lines from the original files that contain a certain term to a new file. I did have the "puts" line of my code working, but after a few changes that doesn't work either! What am I doing wrong?? : There are a bunch of "ex2005##.log" files in the current directory. -------------------- #!c:\ruby\bin\ruby def find_r...

How to write output of a tcl script to a file?
Hi All I am a newbie in Tcl. And when it comes to file I/O, I get extremely confused. I am trying out below example from Tcl tutorial (Link ---> http://www.tcl.tk/man/tcl8.5/tutorial/Tcl25.html ) # # Report all the files and subdirectories in the current directory # For files: show the size # For directories: show that they _are_ directories # set dirs [glob -nocomplain -type d *] if { $dirs != {} } { puts "Directories: foreach d [lsort $dirs] { puts " $d" } } else { puts "(no subdirectories)" } set files [glob -nocomplain -type f *] if { $files != {} } { puts "Files: foreach f [lsort $files] { puts " [file size $f] - $f" } } else { puts "(no files)" } ################################ I want to write the output of this script directly to the new file. help me with that. And if anyone can provide a good tutorial with lots of examples about File I/O in Tcl, that'd be best. thanks in advance. On 13 nov, 08:23, kj <kinjaldesai200...@gmail.com> wrote: > Hi All > > I am a newbie in Tcl. And when it comes to file I/O, I get extremely > confused. > I am trying out below example from Tcl tutorial > (Link --->http://www.tcl.tk/man/tcl8.5/tutorial/Tcl25.html) > > # > # Report all the files and subdirectories in the current directory > # For files: show the size > # For directories: show that they _are_ directories > # > >...

UPnP xml file to WSDL xml file
Hello, could somebody help me to convert the below UPnP service file to WSDL web service file: <serviceList> <service> <serviceType> urn:schemas-upnp-org:service:PowerSwitch:1 </serviceType> <serviceId> urn:upnp-org:service:PowerSwitch:1 </serviceId> <controlURL>/upnp/control/power1</controlURL> <eventSubURL>/upnp/control/power1</eventSubURL> <SCPDURL>/blenderpowerSCPD.xml</SCPDURL> </service> thanks in advance bobby I tried to combine UPnP servive and blenderpowerSCPD.xml and come up with WSDL w...

how to make a file from the strings in a file and redirect the content to these new files
Here is scenari0 223 files copied to this this one big flat file. now how to make this file to 223 files. further explaination: below is excerpt from that one file under xxxxx you will see @TC_ID: :BIC4007 then another @TC_ID: :BIC40008 and has a 223 time with TC_ID: :BICxxx numbers How do I use such a script that makes a file named BIC40008, then another BIC40007 AND copying the content from line @TC_ID: :BIC40007 till one line before the next TC_ID: :BIC40008 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @TC_ID: :BIC40007 @TC_TITLE: @ACT_IDS: @AUTHOR: @AUTO: @CLASS: @GROUP_ID: @RELEASES: @T...

Open folder, read file, close file, open new folder, read file close file etc....
Hello, My current directory has several folders within it. Each folder has the same type of file within it. How do i go from the current directory, into one of the folders, edit the file, then come out of the folder, then go into another folder, edit a file then come out of the folder then into a new one etc etc etc. If this does not make sense i apologise and will try to explain my problem a little better. Any help would be much appreciated. Cheers, Phil Phil: I'm not sure it makes sense. Personally I use the mouse and keyboard for doing this. Were you thinking of something else?...

Creating a TCL Channel from a C FILE* giving strange file handles
Hey Everybody! Having a problem with the Tcl C Library calls I cant seem to= figure out. I'm trying to create a channel from opened FILE *, and use it = in a TCL script that sources the module. So, what I am running so far is: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D int openCFileCmd(ClientData clientData,=20 Tcl_Interp *interp, int objc, Tcl_Obj *CONST o= bjv[])=20 ...

How to capture the output from TCL prompt and save it to a file on Linux file system.
Hello All, I login to TCL prompt and run a simple query which lists few rows. I want to capture those rows and save it to a file on file system. I am working on a Sun Solaris ver. 5.9. Here is the sample query that i run from TCL prompt: >SELECT DISTINCT CATEGORY FROM DS_JOBS; And the Resultant set looks like this: Category............ ABC\ACEIQ\JOBS\C UST_SPCLTY ABC\ACEIQ\JOBS\C UST_SPC SSHIP\SEQ PLIC\CNTRL Any advise is greatly appreciated. Thanks Vini On Mar 22, 7:26=A0pm, Vini <vinay.renukun...@gmail.com> wrote: > Hello All, > > I login to TCL prompt and run a simple query which lists few rows. I > want to capture those rows and save it to a file on file system. I am > working on a Sun Solaris ver. 5.9. > > Here is the sample query that i run from TCL prompt: > > >SELECT DISTINCT CATEGORY FROM DS_JOBS; > > And the Resultant set looks like this: > > Category............ > > ABC\ACEIQ\JOBS\C > UST_SPCLTY > ABC\ACEIQ\JOBS\C > UST_SPC > SSHIP\SEQ > PLIC\CNTRL > > Any advise is greatly appreciated. Wrong group. You mean "SQL" rather than "TCL". -Alex On Mar 22, 2:30=A0pm, Alexandre Ferrieux <alexandre.ferri...@gmail.com> wrote: > On Mar 22, 7:26=A0pm, Vini <vinay.renukun...@gmail.com> wrote: > > > > > > > > > > > Hello All, > > > I login to TCL prompt and run a simple query which lists few rows. I > > want...

tcl-inotify: File & directory level notifications for Tcl. (extension)
This is an announcement for a relatively new Tcl project: tcl-inotify. Tcl-inotify is a Tcl interface to the linux kernel's inotify* service. It provides a Tcl package that enables Tcl scripts to monitor the file system changes at a file and directory level. A large number of file/directory actions can be monitored. A proc is executed asynchronously to notify for changes. * inotify is a Linux kernel subsystem that provides file system event notifications. It was written by John McCutchan with help from Robert Love and later Amy Griffis to replace dnotify. It was included in the mainline kernel starting from release 2.6.13, and could be compiled into 2.6.12 and possibly earlier releases by use of a patch. Its function is essentially an extension to filesystems to notice changes to the filesystem, and report those changes to applications. Home page: http://sourceforge.net/projects/tcl-inotify/ Man page: http://tcl-inotify.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Anyone out there write a *.puz file using tcl?
Subject sez all. On Fri, 10 Apr 2009 07:40:55 -0700 (PDT), razajac wrote: >Subject sez all. Not to me, it doesn't. I used the extension .puz for problem files for my Tk Sudoku solver/assistant. Here's the contents of one such: ....9.6... 3...1...8 67..2..39 ...2...3.. 43..5..87 ...5...1.. 52..6..43 1...9...2 ....2.4... I'ts quite a hard puzzle; it defeated all my program's heuristics and forced me to add backtracking as a last resort. Is .puz used by some other file format or program? -- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK jonathan.bromley@MYCOMPANY.com http://www.MYCOMPANY.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated. On Apr 11, 12:39=A0am, Jonathan Bromley <jonathan.brom...@MYCOMPANY.com> wrote: > On Fri, 10 Apr 2009 07:40:55 -0700 (PDT),razajacwrote: > >Subject sez all. > > Not to me, it doesn't. > > I used the extension .puz for problem files > for my Tk Sudoku solver/assistant. =A0Here's the > contents of one such: > > ...9.6... > 3...1...8 > 67..2..39 > ..2...3.. > 43..5..87 > ..5...1.. > 52..6..43 > 1...9...2 > ...2.4... > > I'ts quite a hard puzzle; it defeated all my program's > heuristics and forced me to add backtracking ...

Web resources about - How to write tcl generated xml file into a new file - comp.lang.tcl

Computer-generated imagery - Wikipedia, the free encyclopedia
Computer-generated imagery ( CGI ) is the application of the field of computer graphics or, more specifically, 3D computer graphics to special ...

Which Nominees, Designers Generated The Most Facebook Buzz During The Golden Globes Awards?
... , Leonardo DiCaprio , and Chanel have in common? They were the female nominee, male nominee, and fashion designer, respectively, that generated ...

Auto-generated message: (someones name) has left this conversation and will no longer see your messages ...
Well I figured out how to stop it for me, do not leave the conversation, instead open the conversation and go to the Actions tab, click "Report ...

User Generated Photos in Open Graph - Facebook-Entwickler
... With the increasing number of users having access to mobile cameras, there is a growing need to be able to share and associate those user-generated ...

Does Hyperlapse signal a bigger shift to user-generated content?
... of the level of seriousness Facebook and Instagram as a whole are taking with video creation. There’s a battle being played out on user-generated ...

Does Google see automatically generated content as a bad thing? - YouTube
Does Google see automatically generated content as a bad thing (i.e. spam)? If I publish uncopyrighted content on my site that is available from ...

Prayers for man who generated love
JOHN McCARTHY'S farewell had been billed as a football funeral. It was attended by a who's who of the game he loved, yet as a tribute it laid ...

ACCC calls for regulation of user-generated restaurant reviews
Now that anyone with an internet connection can share their opinions with a wide audience, user review websites such as TripAdvisor, Urbanspoon ...

CGI - Computer Generated Effects In Movies
CGI has revolutionised filmmaking in the past decade, affecting just about every movie we watch.

Chile earthquake live: Tsunami generated after shallow 8.2 magnitude quake hits in Pacific
Parts of Chile's coastline have been hit by a tsunami after a huge magnitude 8.2 earthquake in the Pacific Ocean.

Resources last updated: 3/13/2016 12:10:58 PM