Hi,
As an example, i have with an import with a description I then want CSVI to search for certain strings / word, and update another field with these values. So if product_desc contains Socks in soze 44, 45 and 46 i want another field filled with 44 45 46.
How can we get this done?
Im trying to use field copy and multireplace, which works technically, but i also want to cut out the rest.
Thanks in advance.
- LaScuderia
- RO CSVI
- Saturday, 19 January 2019
- Subscribe via email
0
Accepted Answer
Pending Moderation
Hello,
Did you regex in Multi replace rule for filter these values? Can you post a screenshot on how you have this setup?
You need to use a regular expression which would read all others except the needed values, you then need to put this regex in Find field of Multi replace plugin and Replace field should be set to empty. That will remove the unwanted string.
So if product_desc contains Socks in soze 44, 45 and 46 i want another field filled with 44 45 46.
Did you regex in Multi replace rule for filter these values? Can you post a screenshot on how you have this setup?
Im trying to use field copy and multireplace, which works technically, but i also want to cut out the rest.
You need to use a regular expression which would read all others except the needed values, you then need to put this regex in Find field of Multi replace plugin and Replace field should be set to empty. That will remove the unwanted string.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hello,
So if product_desc contains Socks in soze 44, 45 and 46 i want another field filled with 44 45 46.
Did you regex in Multi replace rule for filter these values? Can you post a screenshot on how you have this setup?
Im trying to use field copy and multireplace, which works technically, but i also want to cut out the rest.
You need to use a regular expression which would read all others except the needed values, you then need to put this regex in Find field of Multi replace plugin and Replace field should be set to empty. That will remove the unwanted string.
I have not set anything with regex, had little clue on how to approach this. I will see how i can setup regex to filter on values.
Thanks for now

Accepted Answer
Pending Moderation
Hi Tharuna,
To clarify a bit more: (and give an actual example)
We have a field where we have the following data: Schokdemper 33 155.
From this field we need to read only 33 and 155, and replace these values with Alfa Romeo 33 and Alfa Romeo 155. Then in turn these values need to be put in the manufacturer_name field as a seperate manufacturer (so 2 in this case). Sometimes this is just 1 value, and sometimes this can have multiple values.
The field which contains 'Schokdemper 33 155' is also used in multiple other field to create other fields as well btw.
My approach is as follows:
Copy the field which contains the 'Schokdemper 33 155' data to 'manufacturer_name field, then use replacements to replace all car types with their actual manufacturer (which consists of Brand and Type). In the meantime We then need to apply a (negative??) regex to replace all the other data which is not used as a manufacturer.
Can you give us some pointers with that last regex? Or an example regex we can use and modify?
I also noticed we can use php functions for this? My php is exceptionally bad, but i saw some examples when googling
Thanks in advance.
To clarify a bit more: (and give an actual example)
We have a field where we have the following data: Schokdemper 33 155.
From this field we need to read only 33 and 155, and replace these values with Alfa Romeo 33 and Alfa Romeo 155. Then in turn these values need to be put in the manufacturer_name field as a seperate manufacturer (so 2 in this case). Sometimes this is just 1 value, and sometimes this can have multiple values.
The field which contains 'Schokdemper 33 155' is also used in multiple other field to create other fields as well btw.
My approach is as follows:
Copy the field which contains the 'Schokdemper 33 155' data to 'manufacturer_name field, then use replacements to replace all car types with their actual manufacturer (which consists of Brand and Type). In the meantime We then need to apply a (negative??) regex to replace all the other data which is not used as a manufacturer.
Can you give us some pointers with that last regex? Or an example regex we can use and modify?
I also noticed we can use php functions for this? My php is exceptionally bad, but i saw some examples when googling
Thanks in advance.
Accepted Answer
Pending Moderation
Hello,
You need to use regex which will replace all others except numbers in your value. I am not a regex guru but still you can try the below regex to extract only numbers from your string
If you want to use Php functions then you can create your own rule to get your needed values. Next step is to make Schokdemper 33 155 change to Alfa Romeo 33 and Alfa Romeo 155. With the above regex you will get 33 155 from Schokdemper 33 155 but you also need to replace text Alfa Romeo between these numbers. Give a try with the below regex and see if it works.
Find field - (\d+)
Replace field - Alfa Romeo $1
Method is regular expression
These are just examples and i wouldn't say these regex will work perfect for your need. You may need to modify it a little according to your values.
Copy the field which contains the 'Schokdemper 33 155' data to 'manufacturer_name field, then use replacements to replace all car types with their actual manufacturer (which consists of Brand and Type). In the meantime We then need to apply a (negative??) regex to replace all the other data which is not used as a manufacturer.
Can you give us some pointers with that last regex? Or an example regex we can use and modify?
I also noticed we can use php functions for this? My php is exceptionally bad, but i saw some examples when googling
You need to use regex which will replace all others except numbers in your value. I am not a regex guru but still you can try the below regex to extract only numbers from your string
/[^0-9]/
.If you want to use Php functions then you can create your own rule to get your needed values. Next step is to make Schokdemper 33 155 change to Alfa Romeo 33 and Alfa Romeo 155. With the above regex you will get 33 155 from Schokdemper 33 155 but you also need to replace text Alfa Romeo between these numbers. Give a try with the below regex and see if it works.
Find field - (\d+)
Replace field - Alfa Romeo $1
Method is regular expression
These are just examples and i wouldn't say these regex will work perfect for your need. You may need to modify it a little according to your values.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hi Tharuna,
We managed to exclude all string we need to reuse using the following regex:
/(?!156\b)(?!33\b)(?!105\b)(?!Marea\b)(?!115\b)(?!Alfasud\b)\b\w+/i
I then made a rule to replace all names with the full name.
Its not the most beautiful method, but it works
Thanks for your prompt help.
As we have some other issues i will create another topic for those.
Thanks!
We managed to exclude all string we need to reuse using the following regex:
/(?!156\b)(?!33\b)(?!105\b)(?!Marea\b)(?!115\b)(?!Alfasud\b)\b\w+/i
I then made a rule to replace all names with the full name.
Its not the most beautiful method, but it works

As we have some other issues i will create another topic for those.
Thanks!
Accepted Answer
Pending Moderation
Hello,
Glad to know that you found the regex
Glad to know that you found the regex

Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »