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.
Old posts that have not been replied to for several years.
-
GodOfSuicide
- Master
- Posts: 463
- Joined: Mon Jun 17, 2002 8:00 pm
- Location: Austria
Post
by GodOfSuicide »
i tried to reach you on irc the last week (remember that austrian #helpdesk guy ? you seamed to be afk the whole time
-
strikelight
- Owner
- Posts: 708
- Joined: Mon Oct 07, 2002 10:39 am
-
Contact:
Post
by strikelight »
Ofloo wrote:and why use exec ???
Code: Select all
#Usage: [badtext:filter mytextfile.txt badtext]
proc badtext:filter {filename badtext} {
set rfile [open "$filename" "r"]
set wfile [open "tmp/$filename.tmp" "w"]
while {![eof $rfile]} {
gets $rfile line
if {![string match -nocase "*$badtext*" $line]} {
puts $wfile $line
}
}
close $rfile
close $wfile
set rfile [open "tmp/$filename.tmp" "r"]
set wfile [open "$filename" "w"]
foreach line [split [read $rfile] \n] {
puts $wfile $line
}
close $rfile
close $wfile
}
and from what i can say this is os independent
Oy... look at all that unneccessity.... nastay....
Code: Select all
proc badtext:filter {filename badtext} {
set inbuf [split [read [set inf [open $filename r]]][close $inf] \n]
while {[set fpos [lsearch -- $inbuf "*$badtext*"]] != -1} {
set inbuf [lreplace $inbuf $fpos $fpos]
}
puts [set outf [open $filename w]] [join $inbuf \n]
close $outf
}
-
Ofloo
- Owner
- Posts: 953
- Joined: Tue May 13, 2003 1:37 am
- Location: Belguim
-
Contact:
Post
by Ofloo »
GodOfSuicide wrote:i tried to reach you on irc the last week (remember that austrian #helpdesk guy ? you seamed to be afk the whole time
you got my attention write now ... ???
try email support[at]ofloo.net
and irc try #support
Last edited by
Ofloo on Sat Oct 25, 2003 7:20 am, edited 1 time in total.
XplaiN but think of me as stupid
-
Ofloo
- Owner
- Posts: 953
- Joined: Tue May 13, 2003 1:37 am
- Location: Belguim
-
Contact:
Post
by Ofloo »
strikelight wrote:Oy... look at all that unneccessity.... nastay....
nice code
XplaiN but think of me as stupid