[scribus] read gnumeric/Libreoffice Calc files?
Gregory Pittman
gpittman at iglou.com
Mon Jul 26 16:09:50 UTC 2021
On 7/26/21 11:08 AM, dboland9 wrote:
> Someone sent me a spreadsheet full of recipes that I would like to include in a project later this year. I can export csv, but that may not wok well be cause each ingredient is separated by a comma, and each step has a number. I can edit the recipes before exporting if there are any suggestions on how to do it correctly so each recipe has its own name, description, rating, ingredients, and cooking steps.
>
Hi Dave,
You can probably get some help from using a Python script.
Here is a fragment of a script I used to use for printing out a list of my patients with Scribus from a CSV file.
csvfiledata = scribus.fileDialog('CSV file', 'CSV files(*.csv)')
with open(csvfiledata, 'rb') as csvfile:
census = csv.reader(csvfile)
for row in census:
scribus.setStyle('csv',censusbox)
scribus.insertText('\t'.join(row) + '\n', -1, censusbox)
You need to put
import csv at the beginning of the script.
This script presumes the information is organized in rows, the parts separated by commas. The commas are automatically stripped out.
Greg
More information about the scribus
mailing list