Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2003-12-04
2
292 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem Imaging Computers With Clonezilla 2 95
Help stop mail server from sending spam. 27 129
LastLogonTimeStamp Attribute 7 49
How to clone solaris 10 machine 33 146
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

791 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