Please Help using fgets .

I want to extract the integer values of “PE Size”, “Free PE” and Integer Value of “Allocated PE” on vgdisplay output below so I can manipulate this numbers for calculations in C and C++ Programming.

This the sample value of vgdisplay output that needs to be extracted below.
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 7
Open LV 7
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4350
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 8650
Free PE 30
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
Topic archived. No new replies allowed.