I have a text file that contains many rows of this sort of thing:
/*[17:51:27][1 ms]*/ UPDATE `country` SET `region_id` = '4' WHERE `country_id` = '36';
Is there a way that I can use sed
to remove the comments only , so that's everything that starts with a /*
and ends with a */
? This would make the line become:
UPDATE `country` SET `region_id` = '4' WHERE `country_id` = '36';
I know how to use sed
to remove an entire line that starts with something, in the example of a text file with SQL in it it would likely be a hash symbol #
.
perl -ple 's;/\*.*?\*/;;g'