f



redirect text to file from text widget

I'm looking for a handle for the text widget so that I can redirect edited text orginally loaded from a file back into a file. If there was an attribute like the "-textvariable" option in label and entry widgets, I could simply echo it into a file from another widget (button, etc.). Thanks 
0
john6309 (18)
7/1/2006 6:37:28 PM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

2 Replies
721 Views

Similar Articles

[PageSpeed] 44

John Peters wrote:
> I'm looking for a handle for the text widget so that I can redirect
> edited text orginally loaded from a file back into a file. If there
> was an attribute like the "-textvariable" option in label and entry
> widgets, I could simply echo it into a file from another widget
> (button, etc.). Thanks

set data [.textwidget get 1.0 end-1c]

-- 
Bryan Oakley
http://www.tclscripting.com
0
oakley (2074)
7/1/2006 10:27:42 PM
On Sat, 01 Jul 2006 22:27:42 GMT
Bryan Oakley <oakley@bardo.clearlight.com> wrote:

> John Peters wrote:
> > I'm looking for a handle for the text widget so that I can redirect
> > edited text orginally loaded from a file back into a file. If there
> > was an attribute like the "-textvariable" option in label and entry
> > widgets, I could simply echo it into a file from another widget
> > (button, etc.). Thanks
> 
> set data [.textwidget get 1.0 end-1c]
> 
> -- 
> Bryan Oakley
> http://www.tclscripting.com

Thanks Bryan!  That works. 


0
john6309 (18)
7/1/2006 10:43:34 PM
Reply:

Similar Artilces:

redirect text to file; text widget
I've loaded text from a file into the text widget, and having edited it would like to redirect it back into a file, but haven't found a handle for it. If there was an attribute such as the "-textvariable" option for the entry and label widgets, I could echo it into a file from another widget (button, etc). Thanks ..t get 0 end "John Peters" <john@jpeters.net> wrote in message news:20060701143102.70526542.john@jpeters.net... > > I've loaded text from a file into the text widget, and having edited it > would like to redirect it back into a file, but haven't found a handle for > it. If there was an attribute such as the "-textvariable" option for the > entry and label widgets, I could echo it into a file from another widget > (button, etc). Thanks Usman, Your solution is incorrect. The first character in a text index is 1.0, not 0. Usman Muzaffar wrote: > .t get 0 end > > "John Peters" <john@jpeters.net> wrote in message > news:20060701143102.70526542.john@jpeters.net... > >>I've loaded text from a file into the text widget, and having edited it >>would like to redirect it back into a file, but haven't found a handle for >>it. If there was an attribute such as the "-textvariable" option for the >>entry and label widgets, I could echo it into a file from another widget >>(button, etc). Thanks > > >...

text in a widget, text-widget
hello i have an application with a couple of text widgets but i would like to add some functionalities that at first and second sight are not directly supported by the plain text widget itself - ? for example i would like certain lines of text within the textwidget to take different background colors according to certain parameters also i would like to be able to detect certain sentences or words that would become 'links' and by clicking them i would open up different windows any suggestions to solutions and widgets for the above problems ? - i probably could...

Reading Text File, Text Scrolling and erase line from a text file
Hi , How can I Reading Text File, then Text Scrolling by means of keys "page UP" "page Down" and erase a specific line from a text file , when press "F2" key? Best Regards, Lidia from Poland -- ========================================= Pozdrawiam Lidiaa Lidiaa schrieb: > Hi , > > How can I Reading Text File, then Text Scrolling by means of > keys "page UP" "page Down" and erase a specific line from a text > file , when press "F2" key? > > ...

RE: text in a widget, text-widget #2
Johan, Here this will give you an idea how to create a link in a text widget as well as some other tags. HTH Mike use strict; use Tk; use Tk::Dialog; my $mainWindow = MainWindow->new(-title => "Test Tags"); my $sc_width = 100; my $sc_height = 15; my $scrolled = $mainWindow->Scrolled( "Text", -scrollbars => 'se', -background => 'white', -wrap => &...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

Re: text in a widget, text-widget @ 1146167556
Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 ,Van Nieuwenhuize, Mike wrote "Noalim y": > > Johan, > > Here this will give you an idea how to create a link in a text widget as > well as some other tags. > > HTH > > Mike > > use strict; > use Tk; > use Tk::Dialog; > > my $mainWindow = MainWindow->new(-title => "Test Tags"); > > my $sc_width = 100; > my $sc_height = 15; > > my $scrolled = $mainWindow->Scrolled( > ...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

Re: text in a widget, text-widget @ 1145998849
Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 , ****** wrote "Revera y": > of "unsubscribe ptk" to majordomo@lists.stanford.edu > If you wish to unsubscribe from this mailing list, send the message body > This message was posted through the Stanford campus mailing list server. > ++**=3D=3D > -++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--= > > > > > ,=20 > , _________________ > , |---| > , | > , lead > , ::::::opthe > , oo,loent,uaha > , }, > ,...

Tkinter question: howto redirect text output (stdout) to Text widget?
hi all, could anyone post an example how to redirect text output (stdout) to Text widget? Thank you in advance, Dmitrey. ...

concatenating multiple text files into one text file
Hello all, I have a huge number of text files like : spectrum1_300_315.csv spectrum1_315_331.csv spectrum1_331_364.csv spectrum1_364_386.csv spectrum1_386_401.csv ...................................... ....................................... each file contains some headerlines at the beginning and data in 2 columns. I want to concatenate the data of the files into one text file .Can anyone hel me pls?thank u in advance. ...

Converting A Unicode Text File to An ASCII Text File
We have a large number of text files built in Unicode that we need to be read by SAS. SAS does not read Unicode text. To convert the Unicode text to ASCII text we did the following: A Unicode text file adds an additional blank space to each character. To remove this blank character, you can use the code below. The hexidecimal value '00' is a blank character. So remove it using the SAS statement '00'x. The 'x' tells SAS you are reading hexidecimal. Use RECFM=N to tell SAS that you are reading a stream of data that will not conform to a typical file structure. SAS will ...

matrix and text to a text file
Hi, I know some similar question have been solved before but I have been reading for a while and I didn't find the answer of my question so, I ask you. I want to create a text-file (.txt) where I will have some text and some matrixs. The format that i want is something like that: -Title- Name1. Name2. power(dbm): big matrix (12000X400) aprox frequency(hz) vector(1x12) aprox So, i created a m-file that can do this writing with fprintf every single character on the file using lots of for loops. It works good but if the matrix is that size it could take a time (about 7 min...

Text in images to a text file
Hello, Does anyone know of any software for Linux which converts text in images to a text file. I have loads of paper documents that I intend to scan. The contents of these documents needs to eventually end up on a web site but as text. Darren <bobblebob@gmail.com> wrote in message news:1151612491.407262.124690@75g2000cwc.googlegroups.com > Does anyone know of any software for Linux which converts text in > images to a text file. I have loads of paper documents that I intend > to scan. The contents of these documents needs to eventually end up > on a web site but as text....

highlight text in text widget
Hi, I am trying to make widget that displays text. I also want a search keywords available. The way I have envisioned is something similar to emacs search, i.e. it highlights all the occurrences of the keyword that you are interested in. I am trying to find out if that kind of highlighting be done in widget_text or some other widgets. Can anyone help? Thanks neon writes: > I am trying to make widget that displays text. I also want a search > keywords available. The way I have envisioned is something similar to > emacs search, i.e. it highlights all the occurrences of the keyword &g...

in Tcl/tk, How can I redirect stdout to a text widget?
I already wrote a tcl script. there are many output information sent to stdout in the script. Now I'm using TK to optimize this script, I hope to redirect all output information to a text widget, How can i do it? I tried to rediect output information to a file, it's OK. then I want to use "fileevent" command to trace the file's action and then send new information to a text widget. but system say that "filehandle cannot be read" error. I think that the reason should be the file is open for "w" and cannot be read. How can i do it? close stdout set file_a [open "testfile" "w"] fileevent $file_a readable Log # this Log procedure write information to a text widget. Any responses will be very appreciated. thanks. Hans Yin wrote: > > I already wrote a tcl script. there are many output information sent > to stdout in the script. Now I'm using TK to optimize this script, I > hope to redirect all output information to a text widget, How can i do > it? > > I tried to rediect output information to a file, it's OK. then I want > to use "fileevent" command to trace the file's action and then send > new information to a text widget. but system say that "filehandle > cannot be read" error. I think that the reason should be the file is > open for "w" and cannot be read. How can i do it? > > close stdout > set file_a [open ...

How to format a text file just like the RFC-text files?
I want to make some document go like these, what tools can help? Any help would be nice, thanks! BLIOGRAPHY ........................................... 34 APPENDIX A. EXAMPLES ............................................... 36 B. SIMPLE FIELD PARSING ................................... 40 C. DIFFERENCES FROM RFC #733 .............................. 41 D. ALPHABETICAL LISTING OF SYNTAX RULES ................... 44 August 13, 1982 - i - RFC #822 ^L Standard for ARPA Internet Text Messages PREFACE By 1977, the Arpanet employed several informal standards for the text messages (mail) sent among its host computers. It was felt necessary to codify these practices and provide for those features that seemed imminent. The result of that effort was Request for Comments (RFC) #733, "Standard for the Format of ARPA Network Text Message", by Crocker, Vittal, Pogran, and Henderson. The specification attempted to avoid major changes in existing software, while permitting several new features. The framework severely constrains document tone and appear- ance and is primarily useful for most intra-organization communi- cations and well-structured inter-organization communication. It also can be used for some types of inter-process commun...

Read a non text file
How can i convert a weird looking file to text file. I know the main info is stored in the file which looks like below. "����<t���Jч�ĉTV��y�rr��Ph"e~Wm>�E�0Y'p�=C�&�rؙ�<t�Fx�Zo$�+T��=���H Or�r6�S��m&7<�p�q��� u����w}�jlꥎ+_�����Z�?��v��ȉ�XC R�}�_�׍�:�$)�o}��NʨW\&���I@b�#T�B��8���J��CL�ypr\�]R���p\��S�XRҏ�f&?/��� 2�t�_��x���bG���Z�D�v�s [�"��N�# Ѡ�@)�����h'&%�(�)��c�ͼA ���zUZjLRyu�P̤� ��� �W��e�@1'�(��u-nG��p��2_�� T&�6+� _� d�(1Z�E@���h�F�z �~x�fG���s�b�/-+�@��0�%��6�wu�=��z���Y�0...

Reading a text file into a Matlab Matrix
Hello there, I have a text file that contains the following; word11 word12 word13 word14 word21 word22 word23 word24 word31 word32 word33 word34 I want to read it into a 3x4 matrix (each word in a separate cell) I tried to use; data = textread('fileName.txt', '%s', 'delimiter', '\n') - puts each line in one cell data = textread('fileName.txt', '%s', 'delimiter', ' ') - puts each word in one cell but in a 12x1 matrix/array [col1 col2 col3 col4] = textread('tE.txt', '%s %s %s %s', 'delimit...

Text widget
I'm trying to write a text editor with Tk::Text. The Tk::Text widget has a very sophisticated mechanisms using 'tags' for applying formatting (font, size, bold, etc) to the text in the widget. Is there any way to save this formatting when saving the text from the widget to a file? The Tk::TextUndo widget has the Save method - but it strips all tags out and just saves the plain text. I presume one needs a markup language of some sort to represent the tags - and when reading the file back in you apply the tags again. So ... a rich text widget in Tk? Any fancy wa...

Pulling out lines of text from a text file
Hi everybody, I'm looking to write a Catalyst model to basically use a newline delimited database, so that each line of the text file corresponds to a datum. My question isn't about the module per se, but on smart algorithms to pull a single line of text from an arbitrary text file. I know the following would work: #!/usr/bin/perl use warnings; use strict; print "Enter a file\n"; my $file = <STDIN>; print "Enter a number\n"; my $number = <STDIN>; my @array; open FILE, "$file"; while (<FILE>) { push @array; } close FILE; print $a...

text widget: loading dumped text?
Is there an easy way to reload information dumped from a text widget? I'm trying to reproduce and report a bug in the text widget and this would help a lot. -- Russell P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text widget while some text is elided, often a few lines that *should* be displayed are simply blank. It's fairly reproducible but the data is rather complex. Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > > -- Russell > > P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text > widget while some text is elided, often a few lines that *should* be > displayed are simply blank. It's fairly reproducible but the data is > rather complex. What do you mean by "dumped"? Saved? -- Kevin Walzer Code by Kevin http://www.codebykevin.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > It's possible to write code to do this, but there's nothing built-in to Tk or available in tklib. -- Bryan Oakley http://www.tclscripting.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and repo...

Insert text file in a text field ...
Hallo, I have 2 questions: 1) How can I insert a text file into a TEXT field of a table (by an sql instruction) ? 2) How can I insert a microsoft word file into a BLOB field of a table (by an sql instruction) ? Please, could you help me ? Thank you . Fab. On Thu, 18 Oct 2007 06:41:52 -0700, electric_r@yahoo.it wrote: > Hallo, > > I have 2 questions: > > 1) How can I insert a text file into a TEXT field of a table (by an > sql instruction) ? > > 2) How can I insert a microsoft word file into a BLOB field of a table > (by an sql instruction) ? > > Please, could you help me ? This is a task for the application program, not the database itself. -- A way of life that is odd or even erratic but interferes with no rights or interests of others is not to be condemned because it is different. -- Chief Justice Warren E. Burger electric_r@yahoo.it wrote: > Hallo, > > I have 2 questions: > > 1) How can I insert a text file into a TEXT field of a table (by an > sql instruction) ? > > 2) How can I insert a microsoft word file into a BLOB field of a table > (by an sql instruction) ? > > Please, could you help me ? > > Thank you . > > Fab. Look at the LOAD_FILE() function in the manual On 18 Oct, 14:41, electri...@yahoo.it wrote: > Hallo, > > I have 2 questions: > > 1) How can I insert a text file into a TEXT field of a table (by an > sql instruction) ? > > 2) How can...

Pasting Text files into a text field?
I want to past a text file into a text field but it looses it's format. It should appear in a table layout, is there a way round this? Thanks Ernie -- --------------------------------------------------------------------- "Are you still wasting your time with spam?... There is a solution!" Protected by GIANT Company's Spam Inspector The most powerful anti-spam software available. http://mail.spaminspector.com In reply to mSzjb.11$UY1.9@news-binary.blueyonder.co.uk on 10/16/03 4:41 PM by Ernie Faulkner ernie-NO-SPAMfaulkner@blueyonder.co.uk: Hi Ernie, To paste the ...

Loading text files into a text attribute
Hello folks, I have the following problem: I have a bunch of text files, I want to load them into a table where each file will be stored in one row. Question 1: Is there any way how to do this in psql? AFAIK the \copy command interprets \n as a new line and so I can't get it done what I want. So I wrote a C program that parses my text files and anywhere it sees a \n it puts \\n and then concatenates the files, etc. - quite complicated. Question 2: Is there a simpler way of doing this? Thanks in advance Zoltan ---------------------------(end of broadcast)------...

Web resources about - redirect text to file from text widget - comp.lang.tcl

Asteroid Redirect Mission - Wikipedia, the free encyclopedia
The Asteroid Redirect Mission ( ARM ), also known as the Asteroid Retrieval and Utilization ( ARU ) mission and the Asteroid Initiative , is ...

What percentage of PageRank is lost through a 301 redirect? - YouTube
Roughly what percentage of PageRank is lost through a 301 redirect? Sam Harries, Exeter, United Kingdom Have a question? Ask it in our Webmaster ...

CloudFlare boss’s Gmail hacked in redirect attack on 4Chan
Content distribution network CloudFlare reset all its customer API keys over the weekend after its CEO’s personal and corporate Gmail was breached ...

Parramatta shootings: We need to redouble our efforts to redirect all at-risk teens from a destructive ...
He was too young to drive, and too young to vote. We may discover why he killed, but we may not. What we can do is boost our efforts to divert ...

Parramatta shootings: We need to redouble our efforts to redirect all at-risk teens from a destructive ...
He was too young to drive, and too young to vote. We may discover why he killed, but we may not. What we can do is boost our efforts to divert ...

Budget 2015: Generic drug prices expected to fall as Government redirects health spending
Patients will benefit from a significant drop in the price of many common drugs with changes due in next week's budget.

Defence review aims to redirect $1B a year in spending
The Department of National Defence today launched a top-down review of how it manages its back office with a goal of finding about a billion ...

Redirect Permanent
Just a little note to tell you this blog has now completely moved to its new home. I hope you find it nicer, especially more mobile-friendly. ...

Colorado governor candidate redirects volunteers to Douglas County races
KUSA-Republican gubernatorial candidate and current Colorado Secretary of State Scott Gessler is wading into a local school board election. ...

China’s ‘Great Cannon’ Uses DDoS Style Redirects for Censorship
... the great firewall works to block traffic by terminating links; it can’t alter the traffic, just stop it. The great cannon modifies and redirects ...

Resources last updated: 3/13/2016 3:43:27 PM