1. fotonio
  2. RO CSVI
  3. Monday, 06 January 2025
  4.  Subscribe via email
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
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.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 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.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
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/"
  1. more than a month ago
  2. RO CSVI
  3. # 2
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.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
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 #
  1. more than a month ago
  2. RO CSVI
  3. # 4
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.
  1. more than a month ago
  2. RO CSVI
  3. # 5
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]/.
  1. more than a month ago
  2. RO CSVI
  3. # 6
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.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
See attachement, thanks
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 8
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.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 9
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.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Ok, that worked, thank you!
Do i have to apply this patch again when i update to new versions?
  1. more than a month ago
  2. RO CSVI
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!