Solved

Simple Tcl/TK Script to Dump Contents of a File to a Text Widget

Posted on 2003-12-04
2
291 Views
Last Modified: 2013-12-27
What I want to do would seem so simple, but since I'm new to Tcl/TK, I need a jump start from one of you folks. My question is this: how can I dump the contents of a file to a Text GUI?

Thanks!
0
Comment
Question by:pdouglas
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
ID: 9882336
pack [text .t -width 80];
set f [open "./file" r];
while {[gets $f l]>=0} {.t insert end "$l\n"}
0
 

Author Comment

by:pdouglas
ID: 9895852
Thanks, ahoffman.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question