On Sat, 25 Mar 2017 22:32:49 -0700
Cousin Stanley <cousinstan...@gmail.com> wrote:

> James K. Lowden wrote:
> >   https://github.com/jklowden/sqlrpt
> 
>   I installed your  sqlrpt  program under debian linux
>   and managed to successfully run it with an sql query
>   from a file .... 
> 
>     $ sqlrpt -d ../db/test.sql3 -q "`cat stocks_list.sql`" >
> stocks.out
... 
>     Can the floating point numbers be formatted
>     for example .... ah la .... %8.4f

Cousin Stanley, 

Indeed you now can.  I added a -p option, documented in the man page.
You supply the column name & printf format string you want to use for
it.  It works for numbers only: integers and floating point.  Strings
continue to be formatted by tbl & troff. 

$ ./sqlrpt -p "Value,%'6.2f" -d db  -q "select Value  from T limit 4" |
nroff -t | cat -s 
+-------+
|Value  |
+-------+
|  0.94 |
|  0.96 |
|  0.95 |
|  0.93 |
+-------+


--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to