Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# Copyright (c) 2010-2020 openpyxl 

2 

3from openpyxl.cell.text import Text 

4 

5from openpyxl.xml.functions import iterparse 

6from openpyxl.xml.constants import SHEET_MAIN_NS 

7 

8 

9def read_string_table(xml_source): 

10 """Read in all shared strings in the table""" 

11 

12 strings = [] 

13 STRING_TAG = '{%s}si' % SHEET_MAIN_NS 

14 

15 for _, node in iterparse(xml_source): 

16 if node.tag == STRING_TAG: 

17 text = Text.from_tree(node).content 

18 text = text.replace('x005F_', '') 

19 node.clear() 

20 

21 strings.append(text) 

22 

23 return strings