multiple input file generate multiple output files
Status: Beta
Brought to you by:
spadix
Hello,
it is possible to process more .tif file simply using *.tif.
To process the results with another application it would be usefull to get the results of the single input files in single output files that have the same name but another extension ( .brc or .bar ... )
Thanks
Andreas
Without knowing anything else about your application, it seems to me that the proposed output file spew is not a good design... can you provide better justification for why you need it (and why we should maintain the feature)?
To process the results with another application, it may be easiest to integrate the reader with the application?
If that is not appropriate, the XML output format provides the full structured output - including the input file associations. For example, if you really want separate output files, you can use a trivial script or stylesheet (example attached) to create them:
$ ls
barcode-0.png barcode-1.png split.xsl
$ zbarimg -q --xml *.png | xsltproc split.xsl -
$ ls
barcode-0.png barcode-0.png.bar barcode-1.png barcode-1.png.bar split.xsl
split xml results to multiple output files
For some reason I was assuming earlier that you needed a single invocation...just to make sure we're not missing the obvious, have you tried multiple invocations? eg (for sh):
$ for img in *.tif ; do zbarimg -q $img > $img.bar ; done
Hello,
thank you very much. I will use xsltproc even if now I have the overhead to parse the xml files. Probably the feature request I posted was not that good. Maybe it would be possible to add a parameter to zbarimg that adds the filename to the standard non xml output.
I can not use the library because ( don't laugh ) we call zbarimg from a clipper ( dos ) application.
Bye
Andreas
> we call zbarimg from a clipper ( dos ) application.
:)
...multiple invocations as a batch file then:
C:\> dir /b
zbareach.bat
barcode-0.png
barcode-1.png
C:\> type zbareach.bat
@FOR %%f IN (%1) DO @zbarimg -q --raw %%f > %%~nf.bar
C:\> zbareach *.png
C:\> dir /b
zbareach.bat
barcode-0.png
barcode-1.png
barcode-0.bar
barcode-1.bar
Hello,
This was the best support I ever got on sourceforge.
thank you very much
Andreas
> add a parameter to zbarimg that adds the filename to the standard non xml output
Maybe you are missing some of the flexibility of XML? We can very easily transform the structured XML output into whatever other structured or unstructured format you like! Another example is attached that accomplishes the same as the batch file:
$ zbarimg -q --xml *.png | xsltproc splitraw.xsl -
$ cat barcode-0.png.bar
9876543210128
Note that the output no longer contains any XML, only the symbol data on a single line. You could also add the input filename, maybe on a different line or even in a CSV format for import to a spreadsheet...literally whatever you want! Given the power of this full featured output format, It is very hard to justify defining and maintaining new formats.
split xml results to raw text output files
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).