question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not reading last column

See original GitHub issue

Hi,

I’m using the following code to read a excel file, but it’s not reading the last column:

`public static DataSet ReadExcel2003(Stream stream) { DataSet result = new DataSet(); var tmpFile = Path.GetTempPath() + Guid.NewGuid().ToString() + “.xls”;

        FileStream fileStream = File.Create(tmpFile, (int)stream.Length);

        byte[] bytesInStream = new byte[stream.Length];
        stream.Read(bytesInStream, 0, bytesInStream.Length);
        fileStream.Write(bytesInStream, 0, bytesInStream.Length);
        fileStream.Close();
        stream.Close();

        Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("pt-BR");
        using (IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(File.Open(tmpFile, FileMode.Open, FileAccess.Read),ReadOption.Strict))
        {
            result = excelReader.AsDataSet();
        }

        File.Delete(tmpFile);

        return result;
    }

`

I attached the file I’m trying to read, the yellow cells are not being reading.

6031b574-9284-4129-af7f-aa9fa5d50806.zip

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
felipefujiharacommented, Mar 11, 2016

image

0reactions
felipefujiharacommented, Mar 15, 2016

@wizardgsz Yes, I ran TestApp look:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Skipping last column in r with read.csv
I've tried in one line of R to get on data , all 5 of first 6 columns, so not the last one....
Read more >
INFILE not reading last column (numeric variable) of csv file
I'm trying to read in a .csv file in a SAS data step. The last column of the file, a numeric variable, is...
Read more >
Excel power query last column missing in input file
I have created a query some month ago which is no longer working because the last column of my input file (csv) is...
Read more >
Solved: MIssing last column in Power Query
Solved: Hi All, I have a query setup which imports new data from various excel sheets each week. However this morning and for...
Read more >
Incorrect reading of file when last column has all missing ...
All the values of the last column should be set as missing, but the first value of row 2 is put as the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found