remove 'b' from filesize meta-data

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
imager
Posts: 5
Joined: 2012-07-08T15:54:11-07:00
Authentication code: 13

remove 'b' from filesize meta-data

Post by imager » 2012-07-29T03:19:18-07:00

The 'format' command has the option to output the filesize (%e). How to change the output, removing the suffix 'B'?

User avatar
fmw42
Posts: 24740
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: remove 'b' from filesize meta-data

Post by fmw42 » 2012-07-29T11:16:49-07:00

imager wrote:The 'format' command has the option to output the filesize (%e). How to change the output, removing the suffix 'B'?
I presume you mean %b and not %e

In usix, use

convert logo: -format "%b" info: | sed -n 's/B//p'

I don't know how to do that in Windows. See http://www.imagemagick.org/Usage/windows/

Please, in the future, identify your platform and version of IM

Post Reply