Dear all,
I want to do the below:
Read CSV file
Check if special character exists ( ; or * ) in any cell
If character exists (eg. between a word : smi;le) then delete this special character so the string becomes : smile)
In the end I want to have the updated CSV file without the special characters in each cell ( if any)
I am not sure how to do this with “for each”…Please for your help
1 Like
If you are using iteration just use
Replace(“:”,“”) or replace(“*”) @the.christopoulos
Cheers
2 Likes
@pattyricarte am totally confused.
Which activity shall I use and how to do it. With an assign activity?
Could you please give me an example?
1 Like
Sure later stil at the miting @the.christopoulos
2 Likes
Fine
here you go with a xaml
specialchar.zip (2.6 KB)
Cheers @the.christopoulos
@Palaniyappan Could you please attach the .xaml?
1 Like
oh sorry i have attached now in the previous comment
Cheers @the.christopoulos
Sorry for the late reply @the.christopoulos
But theres brother @Palaniyappan to help you out with your problem.
cheers
Happy learning
2 Likes
Kindly let know for any queries or clarification
Cheers @the.christopoulos
This was very helpful and it worked.
But, what If i want to replace the special character inside
the “for each row” loop without converting to string and converting back to csv again?
Can i replace special character while having the data as table?
@Palaniyappan @pattyricarte Could you help with this?
1 Like
i didnt get that buddy
kindly elaborate pls
@the.christopoulos
How can i delete the special characters in some string in the table but inside a “for each row” loop?
Without having to convert the whole table as a string and then convert it again ?
1 Like
yah we can do that
but we need to know at what column the special characters might occurs then we can use a assign activity inside the for each row activity like this
row(“yourcolumnname”) = row(“rowcolumnname”).tostring.replace(“*”,“”)
–as we dont know the column name where the special character might occur and is dynamic so we are converting the dattable to a string as a whole and then it will be easy and faster to replace those special characters
–but still we can do within for each row loop with while loop (to iterate through all columns for each row) inside but it is bit slower when compared to the above method, thats why suggested that buddy
hope this would help you
Cheers @the.christopoulos
Cheers @the.christopoulos
Thank you very much @Palaniyappan !
2 Likes
system
(system)
Closed
October 19, 2019, 1:49pm
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.