See Sample File Attached below xlsx file (IT is not allowing to upload .csv so I uploaded .xlsx)
I want to remove “” from $ amount (Last second row) and
Want to remove , from $ amount.
EX: “$1,234”
Output : $1234
Also It says the file is in UNIX(LF) , I want Windows (CRLF).
I am able to get the $1234 amount through For each row and I use replace string activity. Now I don’t know how should I update that to .csv file.
Thank You
Sample CSV file.xlsx (10.3 KB)
@PALKUMARI_PATEL so basically you want to remove comma from every amount
Main.xaml (6.7 KB)
@PALKUMARI_PATEL please test this one, I am available for further discussion
YEs, If any amount is seperated by , then I want to remove and also want to remove “”.
Can you tell me which activity are you using here ?
Also Please covert the file in .csv and then have to perform solutions. I am getting .csv files.
@PALKUMARI_PATEL can you send me original csv … I am unable to convert it correct way
raja.arslankhan@systemsltd.com
I am using for loop and inside i am using assign activity which contains regex but I am working on excel
Somehow This is not allowing me to upload .csv.
I am sending you here How .csv data will look like.
Thanks
Hi @PALKUMARI_PATEL,
For your current problem this might help:
Amount=System.text.RegularExpressions.Regex.Replace(row.Item(“SALES $”).ToString, “[,]+”,“”)
See if you get desired output in message box as per the sample excel file you had sent.
Thanks & Regards,
Shubham Dutta
I am able to get it through for loop but now , How should I update .csv file ? How can i write this updates to .csv and this is not excel, I’ve to work on .csv file.
Please provide some solution.
Thanks
Hi @PALKUMARI_PATEL,
for writing it to a csv file first create a datatable named output_dt using build datatable activity then add data row amount to it and at last write that output datatable to a csv file using write csv file activity. Eg:-
I am uploading the file also.
Main (1).xaml (9.2 KB)
Thanks & Regards,
Shubham Dutta
Hi @Shubham_Dutta Thanks for sample file. Can you explain what you used here ?
Hi @PALKUMARI_PATEL,
I have attached the screenshots of the process also for your reference, you can see after build data table there is that for each activity.
Please go through the screenshots if you are not able to access few activities in my process or else upgrade your uipath.system.activities package to 22.4.4 version after that you can see all the activities in my process.
Thanks & Regards,
Shubham Dutta
I did that already but what you assigned in Amount ? Unable to get that part.
Alos Are you using For Each row or For each ?
Hi @PALKUMARI_PATEL,
Amount=System.text.RegularExpressions.Regex.Replace(row.Item(“SALES $”).ToString, “[,]+”,“”)
For each row in datatable I am using.
Thanks & Regards,
Shubham Dutta
It is giving below error after processing first row.
ALSO IN wRITE RANGE IT IS JUST WRITING tEXT AMOUNT.
Thanks
Hi @PALKUMARI_PATEL ,
This workflow will only extract the amount and save it in a csv file.
For getting the original sample file with extracted value.
use this for each row in datatable instead of before one.
And
in output you give the datatable which you used in readrange
@Shubham_Dutta Thanks for sharing. It ia not removing “” from $ amount.
It is just removing , from the amount.
Alos can we break that loop after last row of the amount ?
I mean I don’t want it on below section.
Please understand this is according to the sample file you had sent before, please sent the sample file with exact data.
the sample csv file you shared had $1,200 not “$1200”
Here it is not allowing me to attach csv file.
So, sent xlsx file. The file is same as csv file.
Also it is not removing " " from $ amount. Can we remove first that ? And it is making space at the end of amount. Also that is not needed.
Thanks