Skip to main content
2 of 3
Removed the command from the output ; added 4 characters in body; added 1 character in body
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

Tested with sed command and worked fine

command:

sed -r "s/^\s+//g" filename|sed '/^\/\*.*\*\/$/d'

output:

printf("It is /* Comment 2 */\n");
x = 5; /* Comment 3 */
/* Comment 5 */ y = 0;
Praveen Kumar BS
  • 5.3k
  • 2
  • 11
  • 16