This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Delete all the lines in a .txt file

Help for those learning Tcl or writing their own scripts.
Post Reply
H
HÒóme
Voice
Posts: 5
Joined: Fri Sep 11, 2009 1:31 pm

Delete all the lines in a .txt file

Post by HÒóme »

Hi There.

How can i delete all the lines in a .txt file? I dont want to delete the file, just the lines. (or delete the file and create it again, but empty)

Thanks.[/list]
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

Code: Select all

set my_file [open "some_txt_file.txt" w]
close $my_file
H
HÒóme
Voice
Posts: 5
Joined: Fri Sep 11, 2009 1:31 pm

Post by HÒóme »

Thank you very much :)
Post Reply