The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
replace carriage returns
Hello, I have a data that I retrieve in an excel cell, this one is found in an attribute after reading the file.
in these cells I find carriage returns with other info.
I tried to do a replace all with my attribute, \n,but no success.
exemple :
Text1(\n)
Text1
Result i want :
Text1
this is my replaceAll in a generate attribute
replace([Txt], "\n" , "")
i hope it's clear.
thank's for helping
0
Answers
Have you tried \r or \r\n instead? (I can't check myself right now, but it could help maybe...)
Vladimir
http://whatthefraud.wtf
hello @HKI - so carriage returns are funny. They can be represented by a variety of things in unicode. Have you tried using \r instead of \n? In order to debug this, I would recommend encoding the attribute (use the "Encode URL" even though it's not a URL) and see how those carriage returns are coded. Works every time.
Scott
thank's all for your answering.
but sorry i haven't see the solution.
if we take the problem differently. I want to retrieve the first row of my cell.
for exemple in the generate attribute opertor if i could use a substr () function from position 1 to a carriage return, if the Substr() function exist :-)
so my exemple will like this :
Original cell :
Text1
Text2
Result :
substr(cell, 1, carriage return) ==> Text1 (only)
hello @HKI - so the best way for us to help you is for you to post both the excel sheet you're trying to parse, and the RapidMiner process you have built so far. Please post the process in XML format using the </> button. Thanks.
Scott
hi,
her it is my process, and my excel file
hello @HKI ok thank you. That XML is corrupted - it looks like pieces of two processes. And you are using RM 7.5.1? That's a pretty old version. I would highly recommend downloading Studio 7.6.1 (most recent version) by logging into my.rapidminer.com.
Scott
exactly, i have the 7.5 version. i'm trying to donload the right version right know :-)
ok. Let's wait until you upgrade to 7.6.1 and load the process there. That will be much easier. And I don't see the actual Excel file - just images.
Scott
oh dear. OK. Holding pattern confirmed.
Hi @HKI,
the following expression in "Generate Attributes" solves this problem on my side:
Explanation:
Hope this helps,
Edin