I have a text file as shown below:
where $ tells about EOL (end of line) location I have used to illustrate that.
53t83t5 5 gejgi3 gg 4gij503 $
/* rtdrfsetsrhs $
ryhrdhrh $
rhyrdhyyyyyyyyyyyrhyrshrh$
ryhrhrh /$
$
345dfeb terfgb$
/srdtfgyhgfs*/ $
$
$
Now I have to replace every line of /* */
this block with EOL placed at start of the line as shown below, Notice the position of $ for Line 3 that means if there are some characters including whitespace we should not skip it instead we should place EOL at the position of /*
forward slash.
53t83t5 5 gejgi3 gg 4gij503 $
$
$
$
$
$
345dfeb terfgb$
/srdtfgyhgfs/ $
$
$
I was able to detect the block using sed '/\/\*/,/\*\//d inputFile
even I was able to delete the whole block also but I wonder can we do the above one using sed command in .sed script.
NOTE: /*...*/
this is used for illustration of a pattern block we can have different pattern enclosing blocks also, like <--...-->
or !!...!!
however I want to know a snippet for /*...*/
, I can handle all others on my own.