約一些文件的utilite nconvert產品信息:正則表達式:確定從utilite輸出信息使用grep
nconvert -info file.tiff
輸出
** NCONVERT v7.00 (c) 1991-2017 Pierre-E Gougelet (Apr 18 2017/09:49:26) **
Version for Windows NT/9x/2000/Xp/Vista/7 (All rights reserved)
** This is freeware software (for non-commercial use)
Over...
file.tiff : Success
Format : TIFF
Name : tiff
Compression : CCITT Group 4
Width : 3194
Height : 5056
Components per pixel : 1
Bits per component : 1
Depth : 1
# colors : 2
Color model : RGB
Bytes Per Plane : 400
Orientation : Top Left
Xdpi : 600
Ydpi : 600
Page(s) : 30
Info:
Photometric Interpretation: White=0
PhotometricInterpretation: 0
PlanarConfiguration: 1
SamplesPerPixel: 1
Software: LIBFORMAT (c) Pierre-e Gougelet
Metadata : (EXIF)
我需要提取用grep數字信息。假設,我想定義的頁數,我用
nconvert -info file.tiff | grep -oP "(?<=Page\(s\)).*$"
我得到:
: 30
但我只需要數30
!
修改下面也沒有帶來預期的結果
nconvert -info efile.tiff | grep -oP "(?<=Page\(s\)\s+\:).*$"
我怎樣才能得到冒號後的信息?
請問您能否給我介紹一下''...''之間的什麼意思? – Sergio
@Sergio:我已經提出了一些解釋:) – sjsam