# How To Remove SQL Block Comments (/\* \*/)

**URL:** https://www.finalbuilder.com/forums/t/how-to-remove-sql-block-comments/852
**Category:** Discussion
**Created:** [May 28, 2008, 1:32am UTC](https://www.finalbuilder.com/forums/t/how-to-remove-sql-block-comments/852 "2008-05-28T01:32:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 28, 2008, 1:32am UTC](https://www.finalbuilder.com/forums/t/how-to-remove-sql-block-comments/852/1 "2008-05-28T01:32:01Z")

</div>

I would like to remove SQL Block Comments. Currently I'm using File Contents Iterator.  
Is there a way to bypass the tag starting with /\* and ending with \*/?

Thanks

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 28, 2008, 2:13am UTC](https://www.finalbuilder.com/forums/t/how-to-remove-sql-block-comments/852/2 "2008-05-28T02:13:35Z")

</div>

Hi Noah,  
  
Thanks for posting. The solution for this problem is a little trickier than I originally thought, because SQL block comments are multiline, but I have a solution for you.  
  
You can do this using the Text Find / Replace action. This action can use a regular expression to remove the commented sections, and then save the results to a second text file. You can use this text file with the File Contents Iterator. I've attached a sample project which demonstrates this, you'll just need to copy and paste the Text Find / Replace action into your project and change the path on the Find and Replace tabs.

Note that the regular expression in the action is pretty naive - for instance it can't handle something like /\* as part of a SQL string literal, because it'll think it's a comment. It's probably possible to expand the regex to deal with some of these cases, but hopefully it's not necessary.

Regards,

Angus

[SQL Block Comments.fbp6](https://www.finalbuilder.com/forums/uploads/default/original/2X/3/356ef6dcf129250dcbcb9a0f9802b10dd512b605.fbp6) (11.285 KB)
