Do you just want the underlined text to appear in a PDF, all clumped together? Or spread out so it appears in the same position on the pages as it is in the indd document?
What about graphics? Do you want them suppressed too?
I'd tackle this by copying the text to another document and then exporting that. But the specifics would depend on exactly what you're trying to do.
if a page appears a single charterer of underline text, I want to gen full page of pdf
I have a script which find a specify colour, and then gen pdf, I think same meaning, I can find the underline color and the gen pdf.