How can I collapse line stars with same keywordbrowsing

I use c++notepad to write a BDF nastran file. it is not a true linguage.
in order to increase the readability I 'd like collapse line like as a function the row that start with the same keyword.
follow there are an exseple of linei want collaps.