| UNIX/Linux Forum Archives · Rules and Guidelines · Disclaimer |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| am2005 |
Posted: Apr 29 2005, 03:13 AM
|
|
Newbie ![]() Group: Members Posts: 1 Member No.: 958 Joined: 29-April 05 |
I am wondering how to erase all comments from a c or java source code. I think that there has to be usage of sed but I am unsure how to do it. I also believe that since it is somewhat complicated because I need to look for // (comment) and also /* (comment )*/ anywhere within the file and get rid of it. I am baffled because I can get rid of the comment symbols but not the comments. My main problems are where the comment is on the same line as code and also getting rid of the code between the /* and */. Thanks in advance for any help.
For example, If there is code like this: /* ................ ...................... ...................... .................... */ code code code // ........................ // ........................ I want only: code code code |
![]() |
![]() ![]() ![]() |