Board logo

标题: [其他] printf.exe [打印本页]

作者: tmplinshi    时间: 2013-5-11 08:17     标题: printf.exe

Usage:
  printf.exe [Options]
  printf.exe FORMAT [ARGUMENT] ...

Print ARGUMENT(s) according to FORMAT.

FORMAT controls the output as in C printf. Interpreted sequences are:
  \OOO         character with octal value OOO
  \xHH         character with hex value 0xHH
  \uHHHH       Unicode character with hex value 0xHHHH
  \\           backslash
  \a           audible BEL
  \b           backspace
  \f           form feed
  \n           new line
  \r           return
  \t           horizontal tab
  \v           vertical tab
  \PQOALGUISE  (%"'&<>^| =)
  %%           a single %
  %b           ARGUMENT as a string with '\' escapes interpreted

and all C format specifications ending with one of diouxXfeEgGcs,
with ARGUMENTs converted to proper type first. Variable widths are handled.
Positional parameters (%n$... *m$) are handled too.

If there are more string operands than format specifiers, the format string is
reused from the beginning. If there are fewer string operands than format specif
iers,
then string specifiers are treated as if empty strings were supplied,
numeric conversions are treated as if 0 was supplied.

Options:
  --help        display this help and exit
  --version     output version information and exit
  --cp=CodePage set output code page

Examples:
  printf "%5d%4d\n" 1 21 321 4321 54321
  printf "%s, %s %d, %d:%.2d\n" %weekday% %month% %day% %hour% %min%
  printf "%1$s, %3$d. %2$s, %4$d:%5$.2d\n" monday october 4 17 41
  printf "%1$s :: %1$f :: %1$'f :: %1$,f" 1234567.123456789


示例:
C:\>printf \u547d\u4ee4\u884c
命令行


注:


-------------------------------
官网: http://code.google.com/p/mini-gnu/
-------------------------------

http://bcn.bathome.net/s/tool/index.html?key=printf
作者: lxzzr    时间: 2013-8-1 11:06

顶一个,我对win下格式化输出始终不能很好的解决,有了它问题就好办多了




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2