RO CSVI

Removing HTML tags on export

| RO CSVI

The removal of HTML tags on export is a question that is quite simple to do with CSVI using the Replacement feature.

Requirements:

  • CSVI 7 or higher

Steps to remove HTML tags:

  1. Go to Components -> CSVI
  2. Click on Rules in the left menu
  3. Click on New
  4. Fill in a name for the replacement rule
  5. Select the Action
  6. Select the plugin CSVI Multireplace
  7. Click on Save to store the settings and load the rule
  8. Now select the Operation Find and replace
  9. Fill in Find with /<[\/\!]*?[^<>]*?>/i
  10. Leave Replace empty
  11. Set Multiple values to No
  12. Set Method to Regular expression
  13. Optionally set an order
  14. Click on Save & Close
  15. Go to Template fields
  16. Select the template where you want to apply the replacement rule to
  17. Click on the fieldname where the rule needs to be applied to
  18. Now under Rules select the rule you created
  19. Click on Save & Close to save the changes
  20. You will see a wand behind the fieldname indicating that a rule has been applied
  21. Run the export on your export template and you will see that the exported file will have no HTML in the chosen field

Read more ...

Replacement: Append text

| RO CSVI

To add some custom text to the end of a field you can use the Replacement feature of RO CSVI.

Let's say you want to add FREE POSTAGE to your product description field, here is how:

  1. Go to Replacement
  2. Make a new entry with the following settings
    • New Old value: /$/
    • New New value: FREE POSTAGE
    • Type: Regular expression
    • Template: Select the template you use for the export
    • Field: Select the field the replacement is to be used for
    • Click on the Add icon
  3. Do an export of your template

The value of FREE POSTAGE is only an example here of course, you can add any value you like to any field you like.

Read more ...

Troubleshooting import errors

| RO CSVI

Often when we import files we run into errors that the file is not being read correctly. Where to start looking for the cause of the issue and how to solve this?

Checkpoints

Follow these checkpoints to make sure that you have the basics right.

  1. Up-to-date Available Fields
    The list of available fields should be up-to-date before importing starts. If the field list is not up-to-date the import may fail due to missing fields. To update the list of available fields go to Maintenance -> Available Fields -> Click Update or follow Missing fields in RO CSVI document.
  2. A clean CSV file
    A CSV file should not have any extra characters in any place. A good CSV file may look like this:
    "product_sku","product_name"
    A bad CSV file may look like this:
    "product_sku,product_name"
      Here the " at the beginning and end of the line are wrong
    product_sku,product_name,
    Here the trailing comma is wrong
  3. Delimiters
    The template must use the same delimiters as your file has. The type of delimiters does not matter. To know what delimiters your file uses look at your file with Notepad for example.
    Some examples of delimiters are:
    Sample Field delimiter Text enclosure
    "product_sku","product_name" , "
    ~product_sku~^~product_name~ ^ ~
    product_sku|product_name |  

    Check that you have the delimiters filled in your template settings. RO CSVI needs this to know how to read the CSV file. Alternatively you can use the Automatic delimiter detection.
  4. Encoding
    The file must always be encoded in UTF-8 format. No other encoding is supported. See this Save file as UTF-8 on how to save your file as UTF-8 using Notepad2 or using LibreOffice/OpenOffice. This is important because files imported not in UTF-8 encoding will not import correctly with special characters like ë and sentences will be cut off.
  5. Field names
    Use only fieldnames that are available for the type of import you are doing. To see which fieldnames are available go to RO CSVI ---> Available Fields and filter on the type of import you want to do. It is not possible to use any other name. This means that if your CSV file contains the names sku, price, name that these cannot be used, you have to translate them to RO CSVI fieldnames. Your column names will change like this:
    • sku --> product_sku
    • price --> product_price
    • name --> product_name
    This needs to be done for all the fields in your file.
  6. Field data
    Make sure the data is properly formatted according to the specifications. Information on the fields can be found in respective tutorials.
  7. Line endings
    It is best to use Unix or Windows line endings. Mac line endings can give issues, by default they are not supported by PHP. If you have Mac line endings, you can select the option I'm Mac in your template, this will tell RO CSVI to try to read Mac line endings.
  8. Use the RO CSVI Analyzer to check your file for any issues. The CSVI Analyzer is included in RO CSVI and can be found by going to Components -> RO CSVI  -> Maintenance -> Analyzer.
  9. Check the debug information
    The debug report shows every step RO CSVI takes when importing the file. See the How to collect debug information on how to get your debug report. Check the debug information for anything that might be going wrong or post it in the forum.

After having checked these checkpoints your import should be running smoothly. Check out also this Does my CSV file look correct tutorial on checking your CSV file.

Read more ...

Excel and CSV

| RO CSVI

The flexibility of Excel with CSV files is quite limited, so limited even that you cannot use your own field delimiter, text enclosure and encoding when opening a CSV file.

Read more ...

Incorrect column count

| RO CSVI

The single most seen message by users is probably the "Incorrect column count".

What does it actually mean?

The incorrect column count means that the columns CSV Improved has found in your file is not the same as the columns in your configuration. Let's clarify this with some examples.

Example 1, incorrect delimiters:

The CSV file looks like this:

"product_sku","poduct_name","category_path"

The template has delimiters set to:

Field delimiter: ^
Text delimiter: ~

Having incorrect delimiters makes it impossible for CSV Improved to read your file. As CSV Improved looks for the ^ character but it cannot find one, it will read the complete line as a single field. This cannot be identified as a supported field and as a result it gives the error message. Always make sure the delimiters match.

Example 2, the trailing field delimiter:

The CSV file looks like this:

product_sku,poduct_name,category_path
PROD1,Product 1,Products/Software,

The field delimiter used is a comma, this means we have a total of 3 fields:

  1. product_sku
  2. product_name
  3. category_path

The product information we want to import has a total of 4 fields:

  1. PROD1
  2. Product 1
  3. Products/Software

Now we can clearly see that there is an incorrect column count because 3 is not the same as 4. Why are there 4 fields for the product information? As we use the comma as field delimiter, after every comma a new field starts. So the comma after Products/Software also creates a new field. The trailing comma must be removed. Always check your file for trailing field delimiters.

Example 3, the duplicate fields:

The CSV file looks like this:

product_sku,poduct_name,product_name,category_path
PROD1,Product 1,Product 1,Products/Software

The field delimiter used is a comma, this means we have a total of 3 fields:

  1. product_sku
  2. product_name
  3. category_path

The product information we want to import has a total of 4 fields:

  1. PROD1
  2. Product 1
  3. Product 1
  4. Products/Software

Since the product_name field already exists already the same name again is ignored. This leaves you with 3 fields to import while the data contains 4. Either rename or remove the column to solve the issue.

Example 4, the missing field:

The CSV file looks like this:

product_sku,product_name,category_path,product_publish
PROD1,Product 1,Products/Software

The field delimiter used is a comma, this means we have a total of 4 fields:

  1. product_sku
  2. product_name
  3. category_path
  4. product_publish

The product information we want to import has a total of 3 fields:

  1. PROD1
  2. Product 1
  3. Products/Software

Here we have a situation where the configuration fields are more than the data fields. What happens is that in a spreadsheet program like Excel a cell is not exported until it is "touched". In this case the column header product_publish was added but no value was put in for the product. To solve this the cell must be given a space or anything actually so it becomes a used cell after that it will be exported.

Example 5, the wrong number of fields:

It is possible to use the column headers in a file to tell CSV Improved what fields you want to use. There is another way and that is to assign fields to the template used for import via the templates menu.

The CSV file looks like this:

PROD1,Product 1,Products/Software

The template fields assignment looks like:

product_sku
product_name
attribute
category_path

This means we have a total of 4 fields:

  1. product_sku
  2. product_name
  3. attribute
  4. category_path

The product information we want to import has a total of 3 fields:

  1. PROD1
  2. Product 1
  3. Products/Software

This is another situation where the configuration fields are more than the data fields. The solution here is to remove the assigned fields that are not being used.

Read more ...

Subcategories