Bug#977293: Read .xlsx from stdin, write .csv to stdout
Andrius Merkys (2020/12/28 15:23 +0200): > Hi Sébastien, > > On 2020-12-28 15:14, Sébastien Hinderer wrote: > > Actually, > > > > xlsx2csv foo.xlsx > > > > does write the CSV output on stdout. > > Glad the upstream answered your question. > > > I think this bug report can now be closed. > > How about reading from stdin? Can you confirm that /dev/stdin does the > trick? If so, this bug report could indeed be closed. Ye,s, I confirm that xlsx2csv /dev/stdin < f.xlsx produces the content of f.xlsx as a CSV on stdout. Thanks again, Sébastien.
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Hi Sébastien, On 2020-12-28 15:14, Sébastien Hinderer wrote: > Actually, > > xlsx2csv foo.xlsx > > does write the CSV output on stdout. Glad the upstream answered your question. > I think this bug report can now be closed. How about reading from stdin? Can you confirm that /dev/stdin does the trick? If so, this bug report could indeed be closed. Best, Andrius
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Actually, xlsx2csv foo.xlsx does write the CSV output on stdout. I think this bug report can now be closed. Thanks and sorry for the toruble. Sébastien.
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Thanks a lot, Andrius. Yes, I saw that the problem was the (non-)seakability of the file. Not sure why this is needed, though. And thanks a lot for having linked the bug report with the upstream issue! Sébastien.
Bug#977293: Read .xlsx from stdin, write .csv to stdout
reopen 977293 forwarded https://github.com/dilshod/xlsx2csv/issues/213 thanks Dear Sébastien, On 2020-12-27 18:16, Sébastien Hinderer wrote: > Andrius Merkys (2020/12/14 08:16 +0200): >> Have you tried using /dev/stdin and /dev/stdout on the command line? >> This usually does the trick for commands not accepting '-'. > I tried finally and it does not work. It produces the following error: > > Traceback (most recent call last): > File "/usr/bin/xlsx2csv", line 1129, in > xlsx2csv.convert(outfile, sheetid) > File "/usr/bin/xlsx2csv", line 216, in convert > self._convert(sheetid, outfile) > File "/usr/bin/xlsx2csv", line 266, in _convert > outfile = open(outfile, 'w+', encoding=self.options['outputencoding'], > newline="") > io.UnsupportedOperation: File or stream is not seekable. It seems that xlsx2csv requires seekable files/streams. Then /dev/stdout cannot be used, alas. Talking to upstream is the right course of action. > Bug reported upstream at https://github.com/dilshod/xlsx2csv/issues/213 > > I did try to add the Forwarded: pseudo-header, I hope it worked. Thanks for reporting this upstream! Forwarded: pseudo-header works only for new bug reports, for existing ones you have to use the control server [1]. I have reopened the bug and added forward address on the top three lines of this e-mail. [1] https://www.debian.org/Bugs/server-control Best, Andrius
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Forwarded: https://github.com/dilshod/xlsx2csv/issues/213 Dear Andrius, Andrius Merkys (2020/12/14 08:16 +0200): > Have you tried using /dev/stdin and /dev/stdout on the command line? > This usually does the trick for commands not accepting '-'. I tried finally and it does not work. It produces the following error: Traceback (most recent call last): File "/usr/bin/xlsx2csv", line 1129, in xlsx2csv.convert(outfile, sheetid) File "/usr/bin/xlsx2csv", line 216, in convert self._convert(sheetid, outfile) File "/usr/bin/xlsx2csv", line 266, in _convert outfile = open(outfile, 'w+', encoding=self.options['outputencoding'], newline="") io.UnsupportedOperation: File or stream is not seekable. Bug reported upstream at https://github.com/dilshod/xlsx2csv/issues/213 I did try to add the Forwarded: pseudo-header, I hope it worked. Thanks, Sébastien.
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Dear Andrius, Many thanks for your prompt and helpful response! Andrius Merkys (2020/12/14 08:16 +0200): > Hello, > > On 2020-12-13 19:00, Sebastien Hinderer wrote: > > Dear upstream authors, > > Debian is not the upstream of this package. Bug reports filed in Debian > BTS are not automatically forwarded to upstream either. To contact the > upstream, I suggest opening an issue on their GitHub issue tracker > [1]. My bad, sorry. Iwanted to write "dear maintainers" but while doing so I was thinking that it was an upstream bug. My reason for submitting it as a Debian bug was that I wanted to have a feedback not only in terms of whether the feature can be included or not but also in terms of in which version of the Debian package a fix would be included. > > Would it please be possible to extend is so that "-" ban be specified > > both as the name of the input file (meaning to read the .xlsx file > > from standard input) and as the name of the output file, meaning that > > the CSV file is written to stdout? > > > > That way the program could be used in a pipe, which would be very > > convenient. Of course that requires to make sure that all the > > other messages the program could possibly produce are written to stderr. > > Have you tried using /dev/stdin and /dev/stdout on the command line? > This usually does the trick for commands not accepting '-'. No I didn't because, after almost 20 years of use of Unix, I was simply not aware of the existence of these files! So, many thanks for making me realise their existence! Best wishes and thanks again, feel free to close the bug. If I submit an issue I can always write back to link it with the present bug report. Sébastien.
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Hello, On 2020-12-13 19:00, Sebastien Hinderer wrote: > Dear upstream authors, Debian is not the upstream of this package. Bug reports filed in Debian BTS are not automatically forwarded to upstream either. To contact the upstream, I suggest opening an issue on their GitHub issue tracker [1]. > Would it please be possible to extend is so that "-" ban be specified > both as the name of the input file (meaning to read the .xlsx file > from standard input) and as the name of the output file, meaning that > the CSV file is written to stdout? > > That way the program could be used in a pipe, which would be very > convenient. Of course that requires to make sure that all the > other messages the program could possibly produce are written to stderr. Have you tried using /dev/stdin and /dev/stdout on the command line? This usually does the trick for commands not accepting '-'. [1] https://github.com/dilshod/xlsx2csv/issues Best, Andrius
Bug#977293: Read .xlsx from stdin, write .csv to stdout
Package: xlsx2csv Version: 1:0.7.6-1 Severity: wishlist Tags: upstream Dear upstream authors, Many thanks for this very convenient tool. Would it please be possible to extend is so that "-" ban be specified both as the name of the input file (meaning to read the .xlsx file from standard input) and as the name of the output file, meaning that the CSV file is written to stdout? That way the program could be used in a pipe, which would be very convenient. Of course that requires to make sure that all the other messages the program could possibly produce are written to stderr. Many thanks in advance! Sébastien.