How to read formatted data from a file (with example)?

In reply to dave_59:

Hi Dave, We need to undo the $fgets function in one of our projects. Is there a “$unfgets” function in SystemVerilog similar to “ungetc” function in C language?

Appreciate the help.

Thanks,
Satya