@@ -41,7 +41,7 @@ function Base.show(io::IO, o::ExcelFile)
4141end
4242
4343function 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])
4545end
4646
4747"""
@@ -61,7 +61,7 @@ data = readxl(f, "Sheet1!A1:C4")
6161````
6262"""
6363function openxl (filename:: AbstractString )
64- wb = xlrd[ : open_workbook] (filename)
64+ wb = xlrd. open_workbook (filename)
6565 return ExcelFile (wb, basename (filename))
6666end
6767
@@ -71,7 +71,7 @@ function readxlsheet(filename::AbstractString, sheetindex::Int; args...)
7171end
7272
7373function readxlsheet (file:: ExcelFile , sheetindex:: Int ; args... )
74- sheetnames = file. workbook[ : sheet_names] ()
74+ sheetnames = file. workbook. sheet_names ()
7575 return readxlsheet (file, sheetnames[sheetindex]; args... )
7676end
7777
@@ -81,7 +81,7 @@ function readxlsheet(filename::AbstractString, sheetname::AbstractString; args..
8181end
8282
8383function readxlsheet (file:: ExcelFile , sheetname:: AbstractString ; args... )
84- sheet = file. workbook[ : sheet_by_name] (sheetname)
84+ sheet = file. workbook. sheet_by_name (sheetname)
8585 startrow, startcol, endrow, endcol = convert_args_to_row_col (sheet; args... )
8686
8787 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,
9999 isa (nrows, Int) && nrows< 0 && error (" nrows should be :all or positive" )
100100 isa (ncols, Symbol) && ncols!= :all && error (" Only :all or an integer is a valid argument for ncols" )
101101 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
104104
105- cell_value = sheet[ : cell_value]
105+ cell_value = sheet. cell_value
106106
107107 if skipstartrows== :blanks
108108 startrow = - 1
@@ -196,25 +196,25 @@ function readxl(file::ExcelFile, range::AbstractString)
196196end
197197
198198function 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 )
200200 if cellval== " "
201201 return NA
202202 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
205205 return convert (String, cellval)
206- elseif celltype == xlrd[ : XL_CELL_NUMBER]
206+ elseif celltype == xlrd. XL_CELL_NUMBER
207207 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)
210210 if date_month== 0
211211 return Time (date_hour, date_minute, date_sec)
212212 else
213213 return DateTime (date_year, date_month, date_day, date_hour, date_minute, date_sec)
214214 end
215- elseif celltype == xlrd[ : XL_CELL_BOOLEAN]
215+ elseif celltype == xlrd. XL_CELL_BOOLEAN
216216 return convert (Bool, cellval)
217- elseif celltype == xlrd[ : XL_CELL_ERROR]
217+ elseif celltype == xlrd. XL_CELL_ERROR
218218 return ExcelErrorCell (cellval)
219219 else
220220 error (" Unknown cell type" )
224224
225225function readxl_internal (file:: ExcelFile , sheetname:: AbstractString , startrow:: Integer , startcol:: Integer , endrow:: Integer , endcol:: Integer )
226226 wb = file. workbook
227- ws = wb[ : sheet_by_name] (sheetname)
227+ ws = wb. sheet_by_name (sheetname)
228228
229229 if startrow== endrow && startcol== endcol
230230 return get_cell_value (ws, startrow, startcol, wb)
@@ -243,16 +243,16 @@ function readxl_internal(file::ExcelFile, sheetname::AbstractString, startrow::I
243243end
244244
245245function 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 ]
247247end
248248
249249function readxlrange (f:: ExcelFile , range:: AbstractString )
250- name = f. workbook[ : name_map] [lowercase (range)]
250+ name = f. workbook. name_map[lowercase (range)]
251251 if length (name)!= 1
252252 error (" More than one reference per name, this case is not yet handled by ExcelReaders." )
253253 end
254254
255- formula_text = name[1 ][ : formula_text]
255+ formula_text = name[1 ]. formula_text
256256 formula_text = replace (formula_text, " \$ " => " " )
257257 formula_text = replace (formula_text, " '" => " " )
258258
0 commit comments