[Skip to main content](#vessel-content)

#   Export UTF8 rows broken

##

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 8 months ago [\#235004](#235004) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235004 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")* was created by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")*

-- HikaShop version -- : 2.6.1

Hello!

I attach you a CSV that is exported from our database.
We have 2 problems, that whatever we try, we unable to solve. We need help!

1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's "Import data from text" function, the rows are not broken, but the chars are not friendly (see attachment: csv_excel_utf8_01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv_excel_utf8_02.jpg). Not always, but in some cases. What can cause it? How should I solve that?

2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.

Help would be really appreciated!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

10 years 8 months ago [\#235014](#235014) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235014 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

Hi,

1. Your CSV appears just fine on my end when I open it with libreoffice:
[ take.ms/bBcNl](http://take.ms/bBcNl)
So it's not related to HikaShop but to the way you're opening it in Excel.
The solution depends on the version of Excel you're using...
[ superuser.com/questions/407082/easiest-w...with-commas-in-excel](http://superuser.com/questions/407082/easiest-way-to-open-csv-with-commas-in-excel)
[ superuser.com/questions/911369/change-de...ng-of-excel-to-utf-8](http://superuser.com/questions/911369/change-default-encoding-of-excel-to-utf-8)

The simplest though is to use libreoffice. It's free, doesn't have all the unnecessary features of Excel for handling CSVs, and has a nice wizard which lets you select the encoding and the separator when you open a CSV:
[ take.ms/mtmbl](http://take.ms/mtmbl)

2. Change the line: Code:

if( is_numeric($value) &amp;&amp; (preg_match('[^0-9]',$value) &#124;&#124; ltrim($value, '0') === (string)$value)) {

to: Code:

if( is_numeric($value) &amp;&amp; (preg_match('[^0-9]',$value) &#124;&#124; ltrim($value, '0') === (string)$value) &#124;&#124; '0' === (string)$value) {

in the file administrator/components/com_hikashop/helpers/spreadsheet.php and that should fix the problem.

The following user(s) said Thank You: [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 8 months ago [\#235090](#235090) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235090 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

Thank you Nicolas!

I've never heard about LibreOffice before, but it's really opening the file correctly.
Also the 0 quantity problem is solved.
Thanks again!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 7 months ago [\#235382](#235382) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235382 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

Dear Nicolas,
Is there any option - at least modification in the code - to stop exporting the categories in the first rows when making product export?
We do not need it, it's just confusing as we have to scroll every time more then a hundred lines in the CSV.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

10 years 7 months ago [\#235403](#235403) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235403 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

Hi,

Instead of doing an export via the "export" button, you can use an action "export CSV file" of a mass action via the menu System&gt;Mass actions to generate a CSV without categories. You can even select only the columns you want in the CSV.

The following user(s) said Thank You: [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")**
- [![pepecortez's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31475-pepecortez "View pepecortez's Profile") Topic Author
- [ Offline](/forum/user/31475-pepecortez)

Less More

- Posts: 171
- Thank you received: 9
-
-

10 years 7 months ago -  10 years 7 months ago [\#235851](#235851) by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")  Replied by *[pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235851 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

> nicolas wrote: Hi,
>
> Instead of doing an export via the "export" button, you can use an action "export CSV file" of a mass action via the menu System&gt;Mass actions to generate a CSV without categories. You can even select only the columns you want in the CSV.

If I use it that way, am I able to import the products in Products &gt; Import to refresh the data as well if I export just some specified columns?

Last edit: 10 years 7 months ago by [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

10 years 7 months ago [\#235869](#235869) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export UTF8 rows broken](/forum/37-import-export-csv-xls/883520-export-utf8-rows-broken#235869 "-- HikaShop version -- : 2.6.1  Hello!  I attach you a CSV that is exported from our database. We have 2 problems, that whatever we try, we unable to solve. We need help!  1.) When CSV is exported from admin's product list, and then if I open it in Excel without using Excel's &quot;Import data from text&quot; function, the rows are not broken, but the chars are not friendly (see attachment: csv&#95;excel&#95;utf8&#95;01.jpg). If I use Excel's import data from text function, and load the CSV to the table while setting it is UTF8, the chars seems OK, but sometimes (not always) the rows are broken (see attachment: csv&#95;excel&#95;utf8&#95;02.jpg). Not always, but in some cases. What can cause it? How should I solve that?  2.) When exporting, the product quantity field can be 0 (zero). But when I open it in Excel there's no zero in that case, just blank field. And if I forgot to change back it to 0 when it's blank, than when I'm importing the CSV to products, those products show as we have them unlimited on stock.  Help would be really appreciated!")*

Yes. The only requirement is that you export the "product_code column so that the import can link the products in the CSV with the products in the database. And if you have variants, you also need the product_parent_id and the characteristic(s) column(s).

The following user(s) said Thank You: [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84ODM1MjAtZXhwb3J0LXV0Zjgtcm93cy1icm9rZW4/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.087 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
