I want to iterate and check the Model_Name from this two sheet
how to check the model name
String.Equals(AmzMN,FlpMN, StringComparison.OrdinalIgnoreCase)
above condition doesn’t work
I want to iterate and check the Model_Name from this two sheet
how to check the model name
String.Equals(AmzMN,FlpMN, StringComparison.OrdinalIgnoreCase)
above condition doesn’t work
You can try like this as names are little unordered …Instead of actual value use the currentrow(“Column”).ToStrinng
String.Join(",",Regex.Split("Apple Iphone 14(Red,128 GB)".Tolower,"\W").Where(function(x) Not String.IsNullOrEmpty(x)).OrderBy(function(x) x)).Equals(String.Join(",",Regex.Split("Apple Iphone 14(128 GB) - Red".ToLower,"\W").Where(function(x) Not String.IsNullOrEmpty(x)).OrderBy(function(x) x)))
Note: All words should be same…if words are different then this might not work
cheers
Regex is a varoftype?
Regex is a class which contains a split function which can work with regularExpressions
Full NameSpace : System.Text.RegularExpressions.Regex.Split
cheers
Please use fullnamespace instead of regex.Split
System.Text.RegularExpressions.Regex.Split
cheers
nice its wroking
can you explain the function of the code
String.Join(“,”,System.Text.RegularExpressions.Regex.Split(AmzMN.Tolower,“\W”).Where(Function(x) Not String.IsNullOrEmpty(x)).OrderBy(Function(x) x)).Equals(String.Join(“,”,System.Text.RegularExpressions.Regex.Split(FlpMN.ToLower,“\W”).Where(Function(x) Not String.IsNullOrEmpty(x)).OrderBy(Function(x) x)))
I am splitting the string based on any non words character(space,comma,etc) and then ordering all the words and joining them together so that the words on each side if they are same would match…and also removing any empty spaces that i see
String.Join(“,”, - joins using comma
System.Text.RegularExpressions.Regex.Split(AmzMN.Tolower,“\W”). - split the string using any special character
Where(Function(x) Not String.IsNullOrEmpty(x)). - removes empty strinngs from array
OrderBy(Function(x) x)) - orders the array in ascending order
Eg : input 1 : abc def
Inout2 : def abc
Now the function will split on space and then arrange both as per name and then it compares so comprision will be abc,def and abc,def…so both would match
Hope this is clear
Cheers
thakyou @Anil_G Now its clear
23.4.1+Branch.master.Sha.43c76fe6d960fdc239be3af93d0fd47b8ca81224
Not enough memory resources are available to complete this operation.
Error: System.Exception: Not enough memory resources are available to complete this operation.
at System.Diagnostics.Eventing.EventProvider.EtwRegister()
at System.Diagnostics.Eventing.EventProvider…ctor(Guid providerGuid)
at System.Activities.Presentation.DesignerPerfEventProvider…ctor()
at System.Activities.Presentation.View.TypeBrowser.TypeBrowserView…ctor(AssemblyContextControlItem assemblyContext, EditingContext context, Func`2 filter)
at System.Activities.Presentation.View.TypePresenter.HandleBrowseType()
at System.Activities.Presentation.View.TypePresenter.OnTypePresenterDropDownClosed(Object sender, EventArgs e)
at System.Windows.Controls.Primitives.Popup.OnClosed(EventArgs e)
at System.Windows.Controls.Primitives.Popup.DestroyWindow()
at System.Windows.Threading.DispatcherTimer.FireTick()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2147467259
Can you please raise it as a different topic…looks like complete different issue. And also make sure to provide more details of where the error occured and all when you create the topic
This helps in segregation of issues
cheers
resolved after restarting UiPath
@Anil_G
Not String.Join(“,”, System.Text.RegularExpressions.Regex.Split(AmzMN.ToLower, “\W”).Where(Function(x) Not String.IsNullOrEmpty(x)).OrderBy(Function(x) x)).Equals(String.Join(“,”, System.Text.RegularExpressions.Regex.Split(FlpMN.ToLower, “\W”).Where(Function(x) Not String.IsNullOrEmpty(x)).OrderBy(Function(x) x)))
is this correct?
if the two sheet does not have the equal match i want to write the product name in the 3rd excel
Actuallay i have 3 sheets
If the Model name are not equal, i want to write the model_name and price in the third sheet from amazon sheet as amazon in the lowest price. like wise if the flipkart how to done this?
dt1.AsEnumerable.ToList.ForEach(Sub(x) x("NewCol") = String.Join(“,”, System.Text.RegularExpressions.Regex.Split(x("Model_Name").ToString.ToLower, “\W”).Where(Function(y) Not String.IsNullOrEmpty(y)).OrderBy(Function(y) y)))
.Repeat the same for dt2From step 4 I did keep screenshots as well in the below post
Cheers
Amzndt should be added as an argument to invoke code and direction is in/out
Cheers