Python Forum
Modify LibreOffice's ods spreadsheet
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modify LibreOffice's ods spreadsheet
#1
Hello,

Here is a snippet on how to access rows in the worksheet.
The type of the "rows" object is odict_values.
Converting it to a list (i.e. list(rows)) results in a list within a list, e.g. [[['aaa', 'rrr'], ['bbb', 'ztutrutr'], ['cccc', 'zuzu'], ['ddd']]].
Is there a smart way to access spreadsheet content to avoid quite large list processing.
Thanks.

from pyexcel_ods3 import save_data
from pyexcel_ods3 import get_data
path = '/.../test.ods'
data_in = get_data(path)
rows = data_in.values()
for row in rows:
    print(row)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Returning Column and Row Data From Spreadsheet knight2000 0 449 Oct-22-2023, 07:07 AM
Last Post: knight2000
  Editing spreadsheet/csv BSDevo 6 1,041 Sep-01-2023, 05:47 PM
Last Post: BSDevo
  Looking to automate updating a spreadsheet with image from email cubangt 2 983 Feb-14-2023, 03:43 PM
Last Post: cubangt
  Import XML file directly into Excel spreadsheet demdej 0 859 Jan-24-2023, 02:48 PM
Last Post: demdej
  updating Google spreadsheet with gspread mgallotti 0 1,100 Sep-30-2022, 11:26 PM
Last Post: mgallotti
  Python create a spreadsheet with column and row header ouruslife 4 1,646 Jul-09-2022, 11:01 AM
Last Post: Pedroski55
  Searching for URLs and printing the corresponding row from an Excel spreadsheet johnbernard 0 1,285 Aug-20-2021, 06:43 PM
Last Post: johnbernard
  "Switch-to-spreadsheet" entry. Feasible in Python? whatspython 2 2,029 Sep-30-2020, 01:12 PM
Last Post: buran
  PYTHON - GOOGLE... create new spreadsheet? danclark81 3 2,702 Feb-02-2020, 08:57 PM
Last Post: danclark81
  Working with LibreOffice file FASB 0 1,998 Jun-13-2019, 01:23 PM
Last Post: FASB

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020