need help!!!

guys urgently need a script to remove comments from a script
can't find anything like it
any ideas??

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fajar's picture

what kind of comment , is it

what kind of comment , is it /*..*/ or is it "-- line comment" ?

Steve Partridge's picture

Hi fajar i have many line

Hi fajar i have many line comments "--"
the problem is that these comments are at the end of lines
I have no idea how to remove them

miauu's picture

.

use Notepad++. Open the script and remove all lines that starts with --. Then manually remove the /* */ comments.

Steve Partridge's picture

thank you but this method is

thank you but this method is not suitable because the comments are at the end of lines

pixamoon's picture

`

hey

this is only quick script to remove comments on end of line when they start with --

ms = "C:\\test.ms"
 
linesArr = (dotnetClass "System.IO.File").ReadAllLines ms
 
for i = 1 to linesArr.count do if (a = findstring linesArr[i] "--") != undefined do linesArr[i] = substring linesArr[i] 1 (a - 1)
 
(dotnetClass "System.IO.File").WriteAllLines ms linesArr

but if double dash is in string rest of line will be removed too
to detect strings and comments with /* */ in script is more difficult

try if this simple answer works for you

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.