Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Missing header values using option HeaderLines in Import?

Posted 3 years ago

Hello, I have a XLSX file and I import it to Mathematica. All things will right if I didn't add codes:"HeaderLines->1" If I add HeaderLines->1, there are some Missing. enter image description here enter image description here It is weird as the missing things are the same as those before which had been showed no matter there was code:"HeaderLines->1"

Attachments:
POSTED BY: Zhenyu Zeng
3 Replies

... a Dataset can not contain identical duplicate headers, that said Import gets into trouble with the duplicates.

Robert

POSTED BY: Robert Nowak
Posted 3 years ago

But, before, I once see Impert can contains duplicate names for it will add 2 after the duplicate name.

POSTED BY: Zhenyu Zeng

Hi Zhenyu

The Problem here is that the headerline in the xlsx file contains duplicate names. HCO3-, CO2, CO32- appear two times. Also the header for column A and B are identical (empty). Eliminate the duplicates and it will work as expected.

Alternatively you can exactly specify the sheets/columns/rows to import: (Sheet 1, All rows, columns 3;;7

Import["2.xlsx", {"Dataset", 1, All, 3 ;; 7}, "HeaderLines" -> 1]

Robert

POSTED BY: Robert Nowak
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard