# Importing CSV file

**URL:** https://community.stardog.com/t/importing-csv-file/2463
**Category:** Support
**Created:** [May 21, 2020, 1:38am UTC](https://community.stardog.com/t/importing-csv-file/2463 "2020-05-21T01:38:57Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 1:38am UTC](https://community.stardog.com/t/importing-csv-file/2463/1 "2020-05-21T01:38:57Z")

</div>

I am trying to import a csv file, but I am getting this error below;  
 ![Screen Shot 2020-05-20 at 6.38.08 PM](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/1X/9f4eaab2ece7c349290729c9954e99acc39ce108.png)

Can you please help me understand why?

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 1:42am UTC](https://community.stardog.com/t/importing-csv-file/2463/2 "2020-05-21T01:42:31Z")

</div>

Hi Eren,  
We noticed a similar issue when a UTF-8 byte-order-mark is present in the first column of the CSV file when it's exported from Excel. Are you able to check this? Something like `hexdump` or `xxd` would be able to show you the physical bytes of the file.  
Jess

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 1:48am UTC](https://community.stardog.com/t/importing-csv-file/2463/4 "2020-05-21T01:48:29Z")

</div>

Did you download the Excel file and export it to CSV?

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 1:49am UTC](https://community.stardog.com/t/importing-csv-file/2463/5 "2020-05-21T01:49:28Z")

</div>

Yes, I did download as excel and export it to csv

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 1:53am UTC](https://community.stardog.com/t/importing-csv-file/2463/6 "2020-05-21T01:53:04Z")

</div>

You will need to remove the first three bytes of the file. This is a known issue and will be fixed in an upcoming release.

Jess

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 2:00am UTC](https://community.stardog.com/t/importing-csv-file/2463/7 "2020-05-21T02:00:11Z")

</div>

I think I found a way around. If you export as MS-DOS comma separated, it works  
thank you!

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 2:01am UTC](https://community.stardog.com/t/importing-csv-file/2463/8 "2020-05-21T02:01:06Z")

</div>

Glad it's working. Thanks for the update.

---

<div class="post-metadata">

### Author: ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)
#### Post date: [May 21, 2020, 2:03am UTC](https://community.stardog.com/t/importing-csv-file/2463/9 "2020-05-21T02:03:52Z")

</div>

I can’t tell from the error message if you’re running Linux or Windows. There are a bunch of ways to do it in Linux so I’ll just leave their SO post here.

> <https://stackoverflow.com/questions/45240387/how-can-i-remove-the-bom-from-a-utf-8-file>

If you’re on Windows you can open it in notepad++, set the encoding to utf8 and save the file.

Hope that helps.

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 2:09am UTC](https://community.stardog.com/t/importing-csv-file/2463/10 "2020-05-21T02:09:20Z")

</div>

For another file, I am getting this error below. Can you help me with this please? I saved as MS-DOS comma separated, but it is not working

![Screen Shot 2020-05-20 at 7.07.54 PM](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/1X/45d849f1b412dbdddc43be22a19bc8c55f2f4779.png)

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 2:10am UTC](https://community.stardog.com/t/importing-csv-file/2463/11 "2020-05-21T02:10:17Z")

</div>

Can you share the mappings file?

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 2:23am UTC](https://community.stardog.com/t/importing-csv-file/2463/13 "2020-05-21T02:23:45Z")

</div>

[employee.zip](https://community.stardog.com/uploads/short-url/aqNNm9sQOU3CW7ZwOzQegWAInrZ.zip) (172.6 KB)

---

<div class="post-metadata">

### Author: ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)
#### Post date: [May 21, 2020, 2:23am UTC](https://community.stardog.com/t/importing-csv-file/2463/14 "2020-05-21T02:23:49Z")

</div>

Let me try with this file and figure out what's going on.

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 6:51pm UTC](https://community.stardog.com/t/importing-csv-file/2463/15 "2020-05-21T18:51:42Z")

</div>

Please let me know if you figure out how to import

---

<div class="post-metadata">

### Author: ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)
#### Post date: [May 21, 2020, 7:28pm UTC](https://community.stardog.com/t/importing-csv-file/2463/16 "2020-05-21T19:28:59Z")

</div>

I don't know exactly what's causing the problem but if you get rid of all the spaces in the header names you can successfully import your data. The following header line works

`Region,Employee_Code,Last_Name,Local_Date_of_Joining,Designation,Status,Market_Unit,SkillList,Location`

Interestingly there seems to be two space problems. There were two leading spaces before ` LAST NAME` that I removed and then got a different error. Then I replaced the remaining spaces with and underscore and was successful.

---

<div class="post-metadata">

### Author: ![eren](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@eren](https://community.stardog.com/u/eren)
#### Post date: [May 21, 2020, 7:37pm UTC](https://community.stardog.com/t/importing-csv-file/2463/17 "2020-05-21T19:37:23Z")

</div>

Thank you. It is working now

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)
#### Post date: [June 4, 2020, 7:49pm UTC](https://community.stardog.com/t/importing-csv-file/2463/18 "2020-06-04T19:49:09Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
