I am trying to replace the record values from excel.
Eg: The column name is “Transaction Details” and the values are “Payment to 254716119824 - mumbi mwendwa”
Now I want to replace “payment to 254” to "0"716119824 (Just the number need to be written in the same cell)
You can achieve it by looping through your Data Table using For Each Row activity. In the loop you should do a simple assign with a Regex that will delete non-digit characters:
Thank you so much for your quick response. I have implemented the workflow as you explained. But it is failing to identify the row with “Transaction Details”.
Without specifying the range, Read Range will read entire sheet starting from cell A1, while your table starts from A13 (this is why header names are not properly assigned).
Also, you can check this box in the properties of your Write Range:
Honestly saying that, you are brilliant and awesome @loginerror
After making some minor changes as you advised, the output is as I desired. for that I’ve used for each row 2 times, but missing the 0 in front of the number in excel file.
As per my knowledge we cant add 0 (before numbers) in excel until and unless we change the number format to text. At this stage is it possible to add 0 in UiPath using Regex?
Because Excel Application Scope uses the Excel to do the operations, it will automatically apply the default format cell. One way to change would be to invoke VBA code that changes the data type for that column.
However, a simpler (and faster) approach is to not use Excel Application Scope but the other set of Excel activities that work directly on the files. This way the zeros will be kept
It worked without Excel Application Scope because of the difference between the two methods.
Excel Scope opens the Excel file in Excel itself and it gives it a chance to modify the data types of acolumn.
Without Excel scope, the data is written directly to the file without opening the Excel itself. This way Excel has no opportunity to modify data type of the column, and this is also why after opening you get those green marks for the cells in that column.
For your next question, see here:
You can use Directory.GetFiles(“yourPathToTheDirectory”) as an argument of a For Each loop. It returns an array of strings, so make sure to select String as your TypeArgument of the For Each loop:
Trust you are doing well. would you please let me know how can do vlookup.
I have 2 excel files in a folder. file-1 and file-2
Have to compare the columns of “Transaction details” and “Amount” in file 1 with the columns of “Phone Numbers” and “Amount” in file 2
If matches with the phone number and amount, in file-1 need to create a column as “OK/NOT_OK” and print OK if matches otherwise NOT_OK.
It is a bit rough way of handling that request, but I think it works well here.
What it does:
loops over each row from File1
selects rows from File2 that match exactly your condition (= it will select a row from File2 that has Phone Number equal to Transaction details AND that has the same amounts)
checks if exactly one match was found
If yes, it writes OK, if not, NOT OK
I hope it helps and feel free to study the example and modify it as you wish
Hi Everyone,
would anyone please let me know how can we do vlookup.
I have 2 excel files in a folder. file-1 and file-2
Have to compare the columns of “Transaction details” and “Amount” in file 1 with the columns of “Phone Numbers” and “Amount” in file 2
If matches with the phone number and amount, in file-1 need to create a column as “OK/NOT_OK” and print OK if matches otherwise NOT_OK.
@loginerror you are brilliant. appreciated your quick help and support.
Well understood comparing the two excel files adding the status code.
A bit confused regarding the withvlookup file over comparingExcelfiles.
Would you please elaborate a bit.
Would you please help me to add this condition If the Amount is less than 50 write in the column Status Code “Not Ok to Pay” in below IF condition
P_MPESAdt.Select(“[Transaction Details]='”+row.Item(“Phone Number”).ToString.Trim+“’ and [Amount]='”+row.Item(“Amount”).ToString.Trim+“'”).Count =1
Hi,
I am doing flipkart website Data Scrapping. after data received in Excel datatable. i want to filter for pivot the data in sheet2.
I am not able to split/trim or index the required value from sheet1.
Can you guide the same.Mobile_Brandwise.zip (21.9 KB)
From Mobile Name: Samsung Galaxy only these words required
From Mobile Price: Remove - ₹ - only want Value.
From Mobile GB: Only Middle word - 64B ROM, don’t want RAM & Expandable
Copy this data to Sheet2 in pivot or filter format to make a chart of these data.
Split first column values with Space(" ") then result will be array(for ex… arr).
arr(0)+" "+arr(1)
Above statement gives you required answer.
For example Your required “Samsung Galaxy J6” as output then split with respect to “(” then result will be array.
array(0) gives you required result.
StringVariable.SubString(1) Gives you required result
Split the string with respect to “|” then result will be array.
i need the same solution which you mentioned here… please help me on this…
i want to compare mutiple columns in excel1 and excel 2…and if the column matches update it as ‘ok’ not match if it doesnt match …