约一些文件的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