Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:56:03+00:00 2026-06-03T14:56:03+00:00

I am using read.xls() from the gdata package to read Excel workbooks where each

  • 0

I am using read.xls() from the gdata package to read Excel workbooks where each workbook has one sheet. The read fails with the following error.

> read.xls(list.files[[1]])
Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  no lines available in input

I can’t figure out the error. sheetCount() returns the following error.

> sheetCount(list.files[[1]])
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  line 161 did not have 13 elements

But this is odd, because the workbook has 27 columns. And nothing seems out of the ordinary for rows 161+/-1 or columns 13+/-1.

Throughout the workbook repeated entries are blank and you’re expected to manually extend them down (which is impractical for the 750+ workbooks that I would like to read).

I tried manually setting quote='' and quote='\'', but these don’t change the output. Is my problem that read.xls() sees some rows as ragged but not others? Any pointers? (I tried the xlsReadWrite package, but I am on 64bit Win 7 and it only works on 32bit systems).

Thanks!


Update

I followed @G. Grothendieck’s suggestions and get the following.

> k <- count.fields(xls2csv(list.xls[[1]]), sep = ","); k
NULL
> L <- readLines(xls2csv(list.xls[[1]])); L
character(0)

The temp file that xls2csv() generates is empty, so now I can’t figure out why my countSheets() call returns the “line 161, column 13” error.

I also followed @Joran’s suggestions and converted the .xls file to a .csv file in Libre Office and it converts and reads just fine (i.e., it counts 27 fields in all 236 lines and logical readLines() output).


Update 2

I should add that I think that these .xls files are not generated by Excel (my source is a little secretive about their origin), but I don’t get any errors or warnings when I open them in Libre Office.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:56:04+00:00Added an answer on June 3, 2026 at 2:56 pm

    Try this and see if it suggests anything:

    library(gdata)
    k <- count.fields(xls2csv("myfile.xls"), sep = ","); k
    L <- readLines(xls2csv("myfile.xls")); L
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got the following code from here to read an Excel file using
I'm trying to read data from excel (xls) sheet. I'm running Windows 7 64-bit,
I am trying to read an Excel sheet that has some merged cells using
I need to read large excel sheets using Java. The Excel sheet may be
I'm using OleDb to select data from excel spreadsheets. Each spreadsheet can contain many
This is the code I'm using to read an xls file: Microsoft.Office.Interop.Excel.Application excelApp =
I'm using POI library to read excel sheets, xls and xlsx. I'm wondering if
I want to read Excel file in c# using following code string excelFileName =
I'm using gdata-python-client to read data from a Google spreadsheet. My code for reading
How can I read an xls/xlsx file from a controller using Zend framework?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.