I am trying to remove in first row sep=; and … in last row from CSV file .
Is there any way to remove it ?
Not working any another alternate solution??
You can use Read Text File
to read the CSV file content to a string variable and then use Regex.Replace to remove them.
newCSVText = System.Text.RegularExpressions.Regex.Replace(oldCSVText, "^(sep=;\r?\n)|(\r?\n\.\.\.$)", "", System.Text.RegularExpressions.RegexOptions.Multiline)
tried this reading as text file after using this query @ and … is still there any way to remove this also?
please share with us the origin text as text file
kindly note:
@
indicates the verbatim string and is not part of content / string value
… indicates the truncated string and is not part of the content / string value
so it cant be removed ? i want count the rows after that which should be equal to some particular value
As stated by ppr, it seems like you are inspecting the variable in the Locals panel. That is why you see @ and “…”. To see the real content test to write the content to a new file instead and inspect using Notepad.
this is not blocked and still can be done.
But for further assistance:
coming in some korean language
coming like this in locals panel first row (@"sep=;)and last row(…) should be removed as per the image but also should be dynamic
When text is coming with a sep=; start we can trim / replace
the @ we discussed already and there is nothing to remove:
… was discussed and there is nothing to remove
Still we have also the option of:
which maybe can help for the count calculation and can be joined later again to a flatten string
can we can use generate data table on this ? can you share the workflow for the same
When using this string within the generate Datatable kindly note:
the header line is delimited by ;
the data block is delimited by space
so it needs to be harmonized
However, lets focus on the origin topic scope:
- we have shown options to remove the starter line / text
- we elaborated on the @ indicator
- the role of … for truncated visualization
The main scope question is addressed and and should be cleared now.
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum
so you are saying that … cannot be removed the regex you gave sep is getting removed
maybe there is an understanding mismatch.
We removed the first part with one of many options
And also:
“When text is coming with a sep=; start we can trim / replace”
This part i am able to perform but while checking in locals/immediate in last row i am getting as “…” due to which its impacting my dt.rows.count condition .
any regex available or any other approach i tried skiplast also now working
we already mentioned:
And
there should be no … within the text. Otherwise you can verify for you the same as we had shown with the @
strText.Contains("...")
“strText.Contains(”…“)”
this condition is coming as TRUE
then share with us the text file you have used as input. thanks