You CAN open a bsp file and browse it in a text editor - I use editpad www.editpadlite.com
Scroll down near the end of the bsp file - past the binary data, all of the entities are defined there - in plain text.
You may have to turn on wordwrap so everything is displayed for you.
Highlight all of the entity data and copy the selection to the clipboard and then paste it into a new (and much smaller) file.
Make sure that you do NOT save the original .bsp file - just close it.
I don’t think that the entity number is retained in the .bsp though - just the entities information.
This is a good way to learn what can be done with an entity and how it’s formatted.