-1

I need count how many items (lines) have a subtitle file in PGS format. I don't need convert it to SRT or make any OCR operation.

Is there any way to get the number of items in a PGS file using python?

Thanks

santos82h
  • 452
  • 5
  • 15

1 Answers1

0

If you're just trying to find the number of lines, then try this:

num_lines = sum(1 for line in open('myfile.pgs'))
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Spartan2909
  • 101
  • 2
  • 9