jimevins / glabels-qt

gLabels Label Designer (Qt/C++)

Home Page:http://glabels.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glabels-batch-qt will merging CSV content from STDIN be supported?

toggenation opened this issue · comments

Extracting the AppImage to use glabels-batch-qt in a docker environment

chmod +x glabels-3.99-master561-x86_64.AppImage
./glabels-3.99-master561-x86_64.AppImage --appimage-extract
mv squashfs-root /usr/local/glabels-qt
export LD_LIBRARY_PATH=/usr/local/glabels-qt/usr/lib:$LD_LIBRARY_PATH
# have to mess with the LD_LIBRARY_PATH because
# adding the path to /etc/ld.so.conf.d/ and running ldconfig -v 
# says the libraries are truncated
export PATH=/usr/local/glabels-qt/usr/bin:$PATH

/usr/bin/xvfb-run -- /usr/local/glabels-qt/usr/bin/glabels-batch-qt \
-o /tmp/glabelsXxyz 150x200-sample.glabels

The path to the Merge document is embedded into the glabel project XML and glabel-batch-qt reads that path to combine the CSV data with the project file.

I would like to change the merge location to /dev/stdin to allow piping the CSV content in.

The GUI doesn't allow me to enter /dev/stdin as a target so I open the glabels project file and edit the Merge Location to be /dev/stdin by hand. This works fine.

Screen Shot 2020-04-16 at 10 50 02 pm

With glabels-3-batch there was an -i - option which allowed piping the CSV merge content in from stdin.

I note that there has been a feature added to give the ability to pipe the project file in from stdin https://github.com/jimevins/glabels-qt/issues/90.

So my question is, going forward, what will be the accepted way of handling merging the CSV content on the command line? Changing the Merge location to /dev/stdin seems a bit hacky and the above mentioned feature and my use case are in conflict.

How do you merge your .csv File with the glabels template? so that the values from csv are given to the template?

How do you merge your .csv File with the glabels template? so that the values from csv are given to the template?

Are you using the GUI or glabels-batch-qt

The path to the CSV document is embedded into the glabel project (template) XML and glabel-batch-qt reads that path to combine the CSV data with the project file. This is done in the glabels-qt user interface (GUI)

To script this at runtime you would have to programmatically edit the <Merge src="/path/to/your/csvhere/test.csv" type="Text/Comma"> value in the .glabels file to point to where your CSV file is and then run glabels-batch-qt.

There is no ability to pipe the CSV content in via STDIN that I know of for this version.

glabels-batch-qt -p "CutePDF Writer" test.glabels
# test.glabels contains the path to the CSV file embedded in it

Personally I went back to glabels 3.4.1 because it allows piping the CSV content in via STDIN

commented

Hello my .glabels files are not XML files.
I am trying to print from the command line
glabels--qt -i '/home/leo/file.csv' -o '/home/leo/print.ps' but I doesn't recognized the -i parameter or the -o
-v doesn't work and the --help doesn't work either
I succesfully printed with $ glabels-batch-qt ./Documents/S-18477.glabels -p dymo
But I can't text edit S-18477.glabels to change the path of the merging file.
Could you please be more specific on the edits of the .glables file?

thanks

You need to to gunzip the glabels file sometimes it is in gzip format and from that you can edit the xml inside it

Hello my .glabels files are not XML files.
I am trying to print from the command line
glabels--qt -i '/home/leo/file.csv' -o '/home/leo/print.ps' but I doesn't recognized the -i parameter or the -o
-v doesn't work and the --help doesn't work either
I succesfully printed with $ glabels-batch-qt ./Documents/S-18477.glabels -p dymo
But I can't text edit S-18477.glabels to change the path of the merging file.
Could you please be more specific on the edits of the .glables file?

thanks

You need to to gunzip the glabels file sometimes it is in gzip format and from that you can edit the xml inside it

commented

if i save the file with glabels-3 is possible to unzip it and edit the xml.
When i save the file with glabels-qt un try to unzip it I get
gunzip -S glabels /home/leo/S-18477.glabels
gzip: /home/leo/S-18477.glabels: not in gzip format
And when I try to open the glabels-qt saved file on glabels-3 is all broken so my guess it has been a change on the file format.

commented

Sorry my bad. The file that glabels-qt saves is actually a XML file