I am new to uipath and try to convert python code related to datatable into uipath. Please help me to get this task done
I have developed a workflow for Excel automation. I am stuck in between a point during this automation. I want to apply regular Expression in a column of a datatable. Tried many ways but not able to produce exactly desired result as I wants. I have datatable like Input Data sheet in attached excel
This is sample datatable and this has large number of columns. I want to apply regular expression in column C named as ID column. I want to split data in this datatable based upon $, & separator but also wants to ignore(delete) all the values between * and & or * and $. Row where we find empty cell in column C(ID) can be deleted or ignore.
Output Data sheet of attached excel contains output that I want.
I have developed it in python and now I want to convert it into uipath. Below is python code of solution of above problem-
import pandas as pd
df = pd.DataFrame({'Order': ['10-112','10-115'], 'Owner':['shubhman', 'rishab'], 'ID':['89ab$cd&78','']})
df['ID'] = df['ID'].str.replace(r'\*[^&$]*[&$]', '').str.split(r'[$&]') # Remove substrings between * and $ or &
df = df.explode('ID') # Split the rows with multiple IDs into multiple rows
df = df[df['ID'].astype(bool)] # Discard the rows with an empty ID
Could you please help me regarding my problem with workflow
@prasath17 I have attached excel file in the post. You can check that here. In Input Data sheet of excel I have mentioned input data and in output data sheet of this excel I have write output data. You can check it. Thanks for your help in advance Data.xlsx (10.0 KB)
@kumar.varun2 Thank you very much for reply. Python code is producing correct output as I want. You can check output data sheet in attached excel. I can feel what you are thinking. Trying to explain. For 112abc*28&ab, 389&ab*3$8 I want to ignore also character between * and $ or * and & parallel with splitting of data. That’s why it is not considering 28 and 3 value in final output after splitting. I will be very happy if you can help me to produce required output in uipath. Thanks for your help Data.xlsx (10.1 KB)