@@ -41,7 +41,7 @@ function Base.show(io::IO, o::ExcelFile)
41
41
end
42
42
43
43
function Base. show (io:: IO , o:: ExcelErrorCell )
44
- print (io, xlrd[ : error_text_from_code] [o. errorcode])
44
+ print (io, xlrd. error_text_from_code[o. errorcode])
45
45
end
46
46
47
47
"""
@@ -61,7 +61,7 @@ data = readxl(f, "Sheet1!A1:C4")
61
61
````
62
62
"""
63
63
function openxl (filename:: AbstractString )
64
- wb = xlrd[ : open_workbook] (filename)
64
+ wb = xlrd. open_workbook (filename)
65
65
return ExcelFile (wb, basename (filename))
66
66
end
67
67
@@ -71,7 +71,7 @@ function readxlsheet(filename::AbstractString, sheetindex::Int; args...)
71
71
end
72
72
73
73
function readxlsheet (file:: ExcelFile , sheetindex:: Int ; args... )
74
- sheetnames = file. workbook[ : sheet_names] ()
74
+ sheetnames = file. workbook. sheet_names ()
75
75
return readxlsheet (file, sheetnames[sheetindex]; args... )
76
76
end
77
77
@@ -81,7 +81,7 @@ function readxlsheet(filename::AbstractString, sheetname::AbstractString; args..
81
81
end
82
82
83
83
function readxlsheet (file:: ExcelFile , sheetname:: AbstractString ; args... )
84
- sheet = file. workbook[ : sheet_by_name] (sheetname)
84
+ sheet = file. workbook. sheet_by_name (sheetname)
85
85
startrow, startcol, endrow, endcol = convert_args_to_row_col (sheet; args... )
86
86
87
87
data = readxl_internal (file, sheetname, startrow, startcol, endrow, endcol)
@@ -99,10 +99,10 @@ function convert_args_to_row_col(sheet;skipstartrows::Union{Int,Symbol}=:blanks,
99
99
isa (nrows, Int) && nrows< 0 && error (" nrows should be :all or positive" )
100
100
isa (ncols, Symbol) && ncols!= :all && error (" Only :all or an integer is a valid argument for ncols" )
101
101
isa (ncols, Int) && ncols< 0 && error (" ncols should be :all or positive" )
102
- sheet_rows = sheet[ : nrows]
103
- sheet_cols = sheet[ : ncols]
102
+ sheet_rows = sheet. nrows
103
+ sheet_cols = sheet. ncols
104
104
105
- cell_value = sheet[ : cell_value]
105
+ cell_value = sheet. cell_value
106
106
107
107
if skipstartrows== :blanks
108
108
startrow = - 1
@@ -196,25 +196,25 @@ function readxl(file::ExcelFile, range::AbstractString)
196
196
end
197
197
198
198
function get_cell_value (ws, row, col, wb)
199
- cellval = ws[ : cell_value] (row- 1 ,col- 1 )
199
+ cellval = ws. cell_value (row- 1 ,col- 1 )
200
200
if cellval== " "
201
201
return NA
202
202
else
203
- celltype = ws[ : cell_type] (row- 1 ,col- 1 )
204
- if celltype == xlrd[ : XL_CELL_TEXT]
203
+ celltype = ws. cell_type (row- 1 ,col- 1 )
204
+ if celltype == xlrd. XL_CELL_TEXT
205
205
return convert (String, cellval)
206
- elseif celltype == xlrd[ : XL_CELL_NUMBER]
206
+ elseif celltype == xlrd. XL_CELL_NUMBER
207
207
return convert (Float64, cellval)
208
- elseif celltype == xlrd[ : XL_CELL_DATE]
209
- date_year,date_month,date_day,date_hour,date_minute,date_sec = xlrd[ : xldate_as_tuple] (cellval, wb[ : datemode] )
208
+ elseif celltype == xlrd. XL_CELL_DATE
209
+ date_year,date_month,date_day,date_hour,date_minute,date_sec = xlrd. xldate_as_tuple (cellval, wb. datemode)
210
210
if date_month== 0
211
211
return Time (date_hour, date_minute, date_sec)
212
212
else
213
213
return DateTime (date_year, date_month, date_day, date_hour, date_minute, date_sec)
214
214
end
215
- elseif celltype == xlrd[ : XL_CELL_BOOLEAN]
215
+ elseif celltype == xlrd. XL_CELL_BOOLEAN
216
216
return convert (Bool, cellval)
217
- elseif celltype == xlrd[ : XL_CELL_ERROR]
217
+ elseif celltype == xlrd. XL_CELL_ERROR
218
218
return ExcelErrorCell (cellval)
219
219
else
220
220
error (" Unknown cell type" )
224
224
225
225
function readxl_internal (file:: ExcelFile , sheetname:: AbstractString , startrow:: Integer , startcol:: Integer , endrow:: Integer , endcol:: Integer )
226
226
wb = file. workbook
227
- ws = wb[ : sheet_by_name] (sheetname)
227
+ ws = wb. sheet_by_name (sheetname)
228
228
229
229
if startrow== endrow && startcol== endcol
230
230
return get_cell_value (ws, startrow, startcol, wb)
@@ -243,16 +243,16 @@ function readxl_internal(file::ExcelFile, sheetname::AbstractString, startrow::I
243
243
end
244
244
245
245
function readxlnames (f:: ExcelFile )
246
- return [lowercase (i[ : name] ) for i in f. workbook[ : name_obj_list] if i[ : hidden] == 0 ]
246
+ return [lowercase (i. name) for i in f. workbook. name_obj_list if i. hidden== 0 ]
247
247
end
248
248
249
249
function readxlrange (f:: ExcelFile , range:: AbstractString )
250
- name = f. workbook[ : name_map] [lowercase (range)]
250
+ name = f. workbook. name_map[lowercase (range)]
251
251
if length (name)!= 1
252
252
error (" More than one reference per name, this case is not yet handled by ExcelReaders." )
253
253
end
254
254
255
- formula_text = name[1 ][ : formula_text]
255
+ formula_text = name[1 ]. formula_text
256
256
formula_text = replace (formula_text, " \$ " => " " )
257
257
formula_text = replace (formula_text, " '" => " " )
258
258
0 commit comments