f



contents of file

hi,

maybe a very stupid question, but how can I display the contents of a file
to the screen

say I have file 1.txt and I want to have all the contents of 1.txt
displayed, line for line.

thx

Chris


0
citrix (14)
10/25/2003 12:57:08 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

3 Replies
383 Views

Similar Articles

[PageSpeed] 31

Christian van Meer wrote:
> 
> hi,
> 
> maybe a very stupid question, but how can I display the contents of a file
> to the screen
> 
> say I have file 1.txt and I want to have all the contents of 1.txt
> displayed, line for line.

open '1.txt' for input as #1
Do While Not EOF(1)
  Line Input #1, lineBuf
  Debug.Print lineBuf
Loop
Close #1

For an app, add a text or list box and put the data there.  There was
another thread earlier this week that shows how to add a console window
and write to it if that is what you're really asking for...
0
dp_bozarth (473)
10/25/2003 1:19:07 PM
In article <3F9A784B.61975D40@swko.dot.net>,
Duane Bozarth  <dp_bozarth@swko.dot.net> wrote:
>Christian van Meer wrote:
>> 
>> hi,
>> 
>> maybe a very stupid question, but how can I display the contents of a file
>> to the screen
>> 
>> say I have file 1.txt and I want to have all the contents of 1.txt
>> displayed, line for line.
>
>open '1.txt' for input as #1
>Do While Not EOF(1)
>  Line Input #1, lineBuf
>  Debug.Print lineBuf
>Loop
>Close #1
>
>For an app, add a text or list box and put the data there.  There was
>another thread earlier this week that shows how to add a console window
>and write to it if that is what you're really asking for...

For Tcl-coded examples, see <URL: http://wiki.tcl.tk/ReadAndWrite >.
They can be as simple as
  puts -nonewline [read [open 1.txt]]
or, under Unix,
  exec cat 1.txt
-- 

Cameron Laird <claird@phaseit.net>
Business:  http://www.Phaseit.net
0
claird429 (924)
10/25/2003 1:26:44 PM
Cameron Laird wrote:
 
....snip <totally> inappropriate response....

Hides behind embarrased grin w/<very> red face--sorry, I didn't notice
the ng header had changed from the VB group I had just been reading...
:(
0
dp_bozarth (473)
10/25/2003 1:52:54 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...

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...

How to rename files and contents of the file
Hi, I have two files XYZ_INPUT_FILE_ABCD.YYYYMMDD XYZ_INPUT_CONTROL_ABCD.YYYYMMDD In Shell script i have to change the character "_" before ABCD wit dot(.) It should be like this XYZ_INPUT_FILE.ABCD.YYYYMMDD XYZ_INPUT_CONTROL.ABCD.YYYYMMDD and also inside the second file XYZ_INPUT_CONTROL_ABCD.YYYYMMDD th first file name (XYZ_INPUT_FILE_ABCD.YYYYMMDD) is present. So i have t change the character "_" before ABCD with dot(.) Could you please help me out on this. I appreciate your help i advance. Thanks Chinn -- chinn --------------------------------------------------...

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...

split file contents into files
I have extracted some scripts from an Oracle database using the Toad query below. The script body is of datatype HUGHCLOB; which means each script may be from 50 - 200+ lines. N.B. Toad is a tool to query oracle database. select script_name , script_type , '>>>>>' , script_body from script_table order by script_type, script_name; The Toad query returned a single text file like this below. What I want is an shell script, say, AWK, to parse this all-in-one TOAD output file, to split each script into its own script fil...

Filtering files in GetOpenFileName by file content
Is it possible to extend the GetOpenFileName dialog so that it will filter by file CONTENT as well as filename extension? For example, so that it will list *.AVI files, but only those containing DV data. Or is there another way to do this? Thanks I took a quick look at the documentation and it says to set lpfnHook and OFN_ENABLEINCLUDENOTIFY and respond to the CDN_INCLUDEITEM message. On 8 Dec 2003 04:06:10 -0800, cbdeja@my-deja.com (-) wrote: >Is it possible to extend the GetOpenFileName dialog so that it will >filter by file CONTENT as well as filename extension? ...

Replace some stuff in the file with the contents in a file.
Hi all, I've two files, say, file1 and file2. File1 has the following content: ------------- blabla .... The_beginning_mark_of_inserting_file2 here_comes_the_stuff_want_to_be_replaced_by_file2's_content The_end_mark_of_inserting_file2 .... blabla ------------------- From my above description, you can find that I want to replace the specific content in file1 with file2. Any hints on this issue? Regards. -- ..: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :. On 5/2/2011 1:06 AM, Hongyi Zhao wrote: > Hi all, > > I've two files, say, file1 and file2. Fi...

FTP File Transfer; file contents getting changed ?
Hi, I have wriiten a program to transfer a binary file. After transfer. The file contents in the destination machine is getting changed. Please Help. Please advice if i am doing any wrong. The number of bytes getting transfered is correct. only some of the bytes in the file (in the destination machine) are different. I dont know why is this happening. I have appened code segment. { Socket ds = new Socket(serverName, dataPort); if ( f.sendCommand("type I" + f.eol, true) ) { System.out.println("Main: bi"); Syste...

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 .. .. .. .. input a [1000] wire End ======================= Gogo12 wrote: > > 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 > . > . > . > . > input a [1000] wire > ...

appending the contents of multiple text files into 1 file
Hi, is there a simpler/more idiomatic way to append/join the contents of multiple text files into 1 file? this works, but i'm trying to see if there are more succinct methods. thanks! mynewfile =3D File.new('C:\mynewfile.txt', 'w') @myfilenames.each do |mfn| File.open('#{mfn}.txt') do |file| file.each_line {|line| mynewfile.puts(line)} end =20 end mynewfile.close Alle gioved=EC 14 giugno 2007, Paul Danese ha scritto: > Hi, > > is there a simpler/more idiomatic way to append/join the contents of > multiple text files into 1 file? &...

how read content from file in form input type=file
Hello how read content of file selected in form <input type=file... Rf On 26/05/09 00:05, Rafal(sxat) wrote: > how read content of file selected in form <input type=file... For security reasons, it's not possible to do that with JavaScript on the client. You can read the file contents on the server after the form has been submitted. - Conrad On May 25, 6:02=A0pm, Conrad Lender <crlen...@yahoo.com> wrote: > On 26/05/09 00:05, Rafal(sxat) wrote: > > > how read content of file selected in form <input type=3Dfile... > > For security reasons, it...

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 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 ...

Writing contents of an external file to another external file?
Hi, I'm currently working with the ledmac package that I've modified somewhat to meet my needs. Ledmac is used to create critical endnotes and (in somewhat simplified terms) it writes the endnote info into an external file (called \jobname.end) and when a \doendnotes{X} command is called, it closes that file and places an \input{\jobname.end} into the root document. I have created also another file (called \jobname.eaa) in which similar sort or endnote info is written. The problem is that I would like to periodically, first, write _the contents_ of \jobname.eaa into \jobname.end (and then empty .eaa to receive more info, which works ok): essentially to have a command that periodically "dumps" the contents of .eaa file to the .end file. Ho could I do this? I have tried many things and searched this group, as well as a few (La)TeX books but, alas, to no avail. I can of course simply make the package to periodically write "\include{\jobname.eaa}" into the .end file, but this is not desirable, since I don't want the entire, final .eaa file written to those places, just the contents the .eaa file has _accumulated until_ I give the command to write itself into .end. I have been thinking about a TeXnique to somehow save, or create placeholder tokens for the endnote info that now goes into the .eaa file and then just periodically collate and \immediate\write those tokens to the .end file, but I'm not at all sure how to do this. Thank you for ...

"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...

[Tcl] file copy does not "touch" file. Why?
In a situation, when both source and destination files exist, file copy (with -force of course) does not update the last modification time of the destination file. This "feature" has a strong impact on cooperation with 'make'. Is that really intended? I have to do 'touch' externally to make it correct. The external "cp" command on unix does touch the destination file. -- // _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl> \\ L_ |/ `| /^\ ,() <ethourhs(O)gmail.com> // \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx "I am allergic to Java because programming in Java reminds me casting spells" Sektor van Skijlen wrote: > In a situation, when both source and destination files exist, file copy (with > -force of course) does not update the last modification time of the > destination file. This "feature" has a strong impact on cooperation with > 'make'. It's that way because it makes it easier to do archival backups. If you want the mtime of the destination to be *now*, try this: proc creatingFileCopy {source destination} { file copy $source $destination file mtime $destination [clock seconds] } You might argue that there should be an option to tell [file copy] to not copy the metadata. I'd probably not argue the matter, but currently the metadata copy is done, since it's part of pr...

File Contents Won't Update Until File is Opened
Hey, I ran into this problem before, but cant remember if/how I solved it. Anyways, I'm overwriting a file (objfun.m) based on what the user inputs. I'm using: fid=fopen('objfun.m','w'); A bunch complex parsing stuff hapens here.... fclose(fid); Then the new contents of objfun.m are read and used in my program. The problem is objfun.m is not actually changed unless I manually open it. What happens is when I read objfun.m I still get the old contents. If I double click it (manually opening it),I see the new stuff is there. Now, by opening it, it has been chang...

file content
Hi all, Having access to a request_rec *r (ex. http://abc.hu/myapp/abc.xyz), how can I read the content of abc.xyz (wich contains only XML data) and generating a response (wich contains only HTML). Thank you in advance. --------------------------------------------------------------------------- Laszlo Graf ...

awk script to split text file content to multiple files
I have an input text file like this. ------------------------ DEFINE QLOCAL ('Q1') + ... number of lines ... REPLACE DEFINE QLOCAL ('Q2') + ... number of lines ... REPLACE DEFINE QALIAS ('A1') + ... number of lines ... REPLACE DEFINE QALIAS ('A2') + ... number of lines ... REPLACE ------------------------ The input file contains other definitions as well, such as QREMOTE, LISTENER, etc. But I use the above for the sake of simplicity. I want to sp...

Open a file from remote Windows and use the content in the file locally
hi, I am new here, i have been google around for so long on this issue so i decided to stop by and bother you guys. I use tcl and Expect on a Redhat linux system to remotely telnet to a windows system to run some test. end of the test, a file called "log.dat" is generated. then i will need to analyze the number of errors in the log.dat(basically all text) to decide what the windows system should do next. so here comes the question, how do i process the log file, so i can use it locally on Red hat to do a check? (my idea is to store the content of log.dat as a variable locally, then use regular expresstion to check it) newbie here, want to get it done in a quick and dirty way. thanks in advance for your help youyou schrieb: > hi, > > I am new here, i have been google around for so long on this issue so i > decided to stop by and bother you guys. > > I use tcl and Expect on a Redhat linux system to remotely telnet to a > windows system to run some test. end of the test, a file called > "log.dat" is generated. then i will need to analyze the number of > errors in the log.dat(basically all text) to decide what the windows > system should do next. > > so here comes the question, how do i process the log file, so i can use > it locally on Red hat to do a check? (my idea is to store the content > of log.dat as a variable locally, then use regular expresstion to check > it) Not sure. Either have the windows sy...

File contents
Hi Friends, Can you please help in resolving this... There is file called data.txt which contains 256 words of data as follows aaaaaaaa 12345678 bbbbbbbb cccccccc dddddddd eeeeeeee ffffffff rsk said: > Hi Friends, > > Can you please help in resolving this... > > There is file called data.txt which contains 256 words of data as > follows > > aaaaaaaa > 12345678 > bbbbbbbb > cccccccc > dddddddd > eeeeeeee > ffffffff Presumably you pressed "send" prematurely. Care to try again? -- Richard Heathfield <http://www.cpax.org.uk> Emai...

How to create log file and command journal files for a TCL session
I am using TCL as the command language for my C++ application. How do I add the following? 1. Command journal file that records all TCL commands that the user issues during the session. The purpose of this file is to allow someone to reproduce the same command sequence at a later time. 2. Log file that contains everything that was displayed to the user by my application, as well as by TCL. In other words, everything that was output to stdout and stderr. I can imagine how to do this with a redirect, but I wonder if there is something more straightforward. Thank you for your help with one or both of these questions. google@voom.net wrote in news:1159952849.982836.16970@e3g2000cwe.googlegroups.com: > I am using TCL as the command language for my C++ application. How do > I add the following? > > 1. Command journal file that records all TCL commands that the user > issues during the session. The purpose of this file is to allow > someone to reproduce the same command sequence at a later time. > > 2. Log file that contains everything that was displayed to the user by > my application, as well as by TCL. In other words, everything that > was output to stdout and stderr. I can imagine how to do this with a > redirect, but I wonder if there is something more straightforward. > > > Thank you for your help with one or both of these questions. > > 1.) In a former job I had that problem myself, trying to hack geometry...

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 ...

want to get content of one php file in another php file
i have one php file having content Contents of ex1.php file <body> <?php $content = "c://webserver/www/abc.php"; $handle = fopen($content, "r"); echo fread($handle,filesize($content)); ?> </body> this is reading abc.php file in which i m simply using an echo statement. When i execute ex1.php file i cant see the php statement of abc.php file content of abc.php file is <?php echo "hello";?> sarika wrote: > i have one php file having content > > Contents of ex1.php file > <body> > <?php > $content = "c://webserver/www/abc.php"; > $handle = fopen($content, "r"); > echo fread($handle,filesize($content)); > ?> > </body> > this is reading abc.php file in which i m simply using an echo > statement. When i execute ex1.php file i cant see the php statement of > abc.php file > > content of abc.php file is > <?php echo "hello";?> That's interesting, I've found out that it's the browser that's hiding <?php ?> tags within .phpx pages. Probably to avoid short tags scripts (on a server that doesn't allow them) from getting leaked by visitors who don't know about this browser trick, until the dev' realizes his error. Not a good thing, IMO; dev's should take care, themselves, and it's still not secure since the hidden string is still in the rendered source. And now we don't know how ...

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 ...

Web resources about - contents of file - comp.lang.tcl

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Portal:Contents/Culture and the arts - Wikipedia, the free encyclopedia
The word culture is derived from the Latin root cultura or cultus meaning to "inhabit, cultivate, or honour". In general, culture refers to human ...

SuperPhone and Apple's Future Content Strategy, Best Buy Is Betting on iPhone 7
... sales tool called SuperPhone . Upon closer examination, the ideas underpinning SuperPhone match what I suspect is Apple's long-term content ...

L'Oreal Creates Unbranded Content Hub to Woo Beauty Fans
In a world that's all about return on investment, why would a major marketer invest in a global content hub that carries no branding and no e-commerce ...

Next Up for Facebook Messenger: Content from Publishers?
The next addition to Facebook Messenger may be content sent directly by publishers via the application. Three sources told Marketing Land that ...

4 Reasons Why Your Content Marketing Strategy Is Failing
In his famous essay from 1996, Bill Gates declared that “content is king”. While the phrase has become an overused cliché by this point, it still ...

India To Appeal WTO Verdict On Domestic Solar Content Usage, Again
... of India’s National Solar Mission did not conform to international trade laws. [&hellip India To Appeal WTO Verdict On Domestic Solar Content ...

Ovation Brands Is Already Selling The Contents Of Buffets Closed On Sunday
... and proprietary items,” the auction notice says. Some things might have been carried off to other buffets, but the starting bid for the contents ...

Virginia lawmakers obsess over sexual content in the classroom
... angles to become the first state in the nation to direct teachers K-12 teachers to inform parents if they're teaching "sexually explicit content," ...

Post ‘Spotlight’ Oscar And ‘The Revenant’, Anonymous Content Explores Minority Stake Sale
... Picture Oscar win for Spotlight , Best Picture nomination for The Revenant and Golden Globe win for Mr. Robot , Steve Golin ’s Anonymous Content ...

Resources last updated: 3/13/2016 8:30:52 PM