hey, i was bored yesterday and coded this in about 2 hours. Hope you guys find it useful. Tell me what you think? it is ment for single char '\n' terminated comments. So it won't really work for C but it works great with asm and sql code.
<a href="http://www.osdever.net/temp/xsism/remove.zip" target="newwin">Get it here.</a>
i hope this board allows html
Comment Filterer
RE:Comment Filterer
Why would you want to _remove_ comments? (I'm simply guessing by the .zip name... I'm at work, and can't download the actual app...)
Unless you're stealing/borrowing/using someone elses code constantly and don't want anyone to know...?
Cheers,
Jeff
Unless you're stealing/borrowing/using someone elses code constantly and don't want anyone to know...?
Cheers,
Jeff
RE:Comment Filterer
oh yeah, that's it, i was stealing some code from like 20 diff people, and they all had different comment methods
no
kj and i were actually backing up our mysql DB and there was a problem importing it to a diff version mysql so we had to take out a ton o '#' comments but there was too many. So i made this thing real fast used it and added some functionality after the basic idea worked.
It may come in handy for cutting down on src size if you want a clean, commentless tree? I'm sure there are plenty of uses. Besides, ocde is easier to read when it isn't litered with comments.
mr. xsism
no
kj and i were actually backing up our mysql DB and there was a problem importing it to a diff version mysql so we had to take out a ton o '#' comments but there was too many. So i made this thing real fast used it and added some functionality after the basic idea worked.
It may come in handy for cutting down on src size if you want a clean, commentless tree? I'm sure there are plenty of uses. Besides, ocde is easier to read when it isn't litered with comments.
mr. xsism
RE:Comment Filterer
Fair enough I've actually had similar issues with my web server not liking mysqldump's -- comments. However, this is where awk really comes in handy, though...
/^--/ { skip=1}
{
if(skip == 0) print $0;
skip = 0
}
That's what I use to remove 'em If you're using a unix system, you should check it out... you can do some pretty trippy stuff in even less time...
Cheers,
Jeff
/^--/ { skip=1}
{
if(skip == 0) print $0;
skip = 0
}
That's what I use to remove 'em If you're using a unix system, you should check it out... you can do some pretty trippy stuff in even less time...
Cheers,
Jeff
RE:Comment Filterer
kool, when i'm in linux next time i'll check it out. I use linux occasionally
mr. xsism
mr. xsism