Hi, i would like to make a replace rule for content export so when it finds the character ~ in a field to replace it with end-of-line in the exported csv file. So after a ~ the csv continues to a new line.
How i can do it?
Thank you
- fotonio
- RO CSVI
- Monday, 06 January 2025
- Subscribe via email
0
Accepted Answer
Accepted Answer
Pending Moderation
Hi,
So I did some digging and found out why this is not working for you. The value of \r\n must be quoted in double quotes for the system to understand that it is a new line. Attached is a patch file that you can load. After that is done you can use the \r\n in your replacement rule and it will be treated as a new line.
Let me know how it goes.
So I did some digging and found out why this is not working for you. The value of \r\n must be quoted in double quotes for the system to understand that it is a new line. Attached is a patch file that you can load. After that is done you can use the \r\n in your replacement rule and it will be treated as a new line.
Let me know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- more than a month ago
- RO CSVI
- # Permalink
Accepted Answer
Pending Moderation
Hi,
No need to apply the patch again, I will include this in the next release together with a fix for not using multiple values.
No need to apply the patch again, I will include this in the next release together with a fix for not using multiple values.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
I have tried with regular expression method, Text to find: /~/ Replace with: \r\n
and i get this:
Status error: 500
Status message: error
{"error":true,"code":0,"message":"PlgCsvirulesMultireplace::delimiterEscapeSequence(): Argument #1 ($delimiter) must be of type array, string given, called in \/var\/www\/vhosts\/mydomain.com\/httpdocs\/plugins\/csvirules\/multireplace\/multireplace.php on line 254"}
Also tried with /\r\n/ or "\r\n" or "/\r\n/"
and i get this:
Status error: 500
Status message: error
{"error":true,"code":0,"message":"PlgCsvirulesMultireplace::delimiterEscapeSequence(): Argument #1 ($delimiter) must be of type array, string given, called in \/var\/www\/vhosts\/mydomain.com\/httpdocs\/plugins\/csvirules\/multireplace\/multireplace.php on line 254"}
Also tried with /\r\n/ or "\r\n" or "/\r\n/"
Accepted Answer
Pending Moderation
Hi,
Did you try something already? You are going to need to create replacement rule of the type regex where you look for the /~/ and replace it with \r\n That should be enough to make it work.
Let us know how it goes.
Did you try something already? You are going to need to create replacement rule of the type regex where you look for the /~/ and replace it with \r\n That should be enough to make it work.
Let us know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Yes i tried several combinations for the replace. It always outputs \r\n as text inside the csv.
My settings in Separator options of the template are
Category Separator /
Values Separator ^
Item Separator $
Fields Separator ~
Nested Values Separator #
My settings in Separator options of the template are
Category Separator /
Values Separator ^
Item Separator $
Fields Separator ~
Nested Values Separator #
Accepted Answer
Pending Moderation
Hello,
You need to use RO CSVI Multi replace rule to find ~ and replace with \r\n. As Roland mentioned you can use regular expression in Multi replace rule to do the replacement.
You need to use RO CSVI Multi replace rule to find ~ and replace with \r\n. As Roland mentioned you can use regular expression in Multi replace rule to do the replacement.
Accepted Answer
Pending Moderation
Hello, this is i am doing but it doesnt work. In the replace field \r\n\ is not recognized as special character but as text. The same with regex, i have tried /\r\n/ too, /[\r\n]/.
Accepted Answer
Pending Moderation
Hello,
Please share export template XML to check. To get the template XML file from RO CSVI templates list page select the export template and click on Backup templates button. Post the downloaded XML file. I will check the rule from your template.
Please share export template XML to check. To get the template XML file from RO CSVI templates list page select the export template and click on Backup templates button. Post the downloaded XML file. I will check the rule from your template.
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
Let me explain what i am trying to do.
I am exporting values from content joomla custom fields. Some fields are Subform type and have multiple values separated by ~. So i try to put these values in a separate line as if they were from different articles.
Ex.
field1_value1.1^field1_value1.2^field1_value1.3^field1_value1.4^field1_value1.5^field1_value1.6^field1_value1.7~field1_value2.1^field1_value2.2^field1_value2.3^field1_value2.4^field1_value2.5^field1_value2.6^field1_value2.7^field2_value1.1^field2_value1.2^field3_value1^title^modified^modified_by_name^modified_by
Desired result:
field1_value1.1^field1_value1.2^field1_value1.3^field1_value1.4^field1_value1.5^field1_value1.6^field1_value1.7
field1_value2.1^field1_value2.2^field1_value2.3^field1_value2.4^field1_value2.5^field1_value2.6^field1_value2.7^field2_value1.1^field2_value1.2^field3_value1^title^modified^modified_by_name^modified_by
In the file attached is the template with the rule to replace ~ with \r\n but doesn t work.
I am exporting values from content joomla custom fields. Some fields are Subform type and have multiple values separated by ~. So i try to put these values in a separate line as if they were from different articles.
Ex.
field1_value1.1^field1_value1.2^field1_value1.3^field1_value1.4^field1_value1.5^field1_value1.6^field1_value1.7~field1_value2.1^field1_value2.2^field1_value2.3^field1_value2.4^field1_value2.5^field1_value2.6^field1_value2.7^field2_value1.1^field2_value1.2^field3_value1^title^modified^modified_by_name^modified_by
Desired result:
field1_value1.1^field1_value1.2^field1_value1.3^field1_value1.4^field1_value1.5^field1_value1.6^field1_value1.7
field1_value2.1^field1_value2.2^field1_value2.3^field1_value2.4^field1_value2.5^field1_value2.6^field1_value2.7^field2_value1.1^field2_value1.2^field3_value1^title^modified^modified_by_name^modified_by
In the file attached is the template with the rule to replace ~ with \r\n but doesn t work.
Accepted Answer
Pending Moderation
Hi,
In your replacement rule, set the Multiple values to Yes and let me know how that goes. That is how I tested it.
In your replacement rule, set the Multiple values to Yes and let me know how that goes. That is how I tested it.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
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 »