Hi,
How can I absolute comparison column 0 and codeToCompare because sometimes
column 0: C0392
codeToCompare : C0392 & C0392.(dot)
I want compare C0392 = C0392
dtDeposit.AsEnumerable.Where(Function(x)x(0).ToString.Equals(codeToCompare)).ToArray
Hi,
How can I absolute comparison column 0 and codeToCompare because sometimes
column 0: C0392
codeToCompare : C0392 & C0392.(dot)
I want compare C0392 = C0392
dtDeposit.AsEnumerable.Where(Function(x)x(0).ToString.Equals(codeToCompare)).ToArray
HI,
Can you share specific input sample and expected result as file?
Regards,
Hi @anh.nguyen
Try this:
dtDeposit.AsEnumerable.Where(Function(x) x(0).ToString.TrimEnd("."c).Equals(codeToCompare)).ToArray
Hope it helps!!
hi,
Read Range DEPOSIT file = dtDeposit. have column 0 have : C00392âŚ
For each row data dtARRSheetF assign codeToCompare column 0: have C00392, C00392.(dot)
Assign matchedRows = dtDeposit.AsEnumerable.Where(Function(x)x(0).ToString.Equals(codeToCompare)).ToArray
Condition: matchedRows.Length > 0
expected result: find dtDeposit(C00392) = dtARRSheetF (C00392) not C00392.(dot)
Thank you
Still compare not correct
@anh.nguyen
Your condition was C01120 must be equal to C01120 without dot right. Please clarify.
Regards
Yes, absolute comparison
The condition i have written is to trim the dot at the end and compare with codesToCompare in the above query.
Please share an dummy data input excel file so that I can help you with that.
Regards
number of character of codeToCompare is fixed format?
i see in here is 5 characters
or
last character need remove it âdotâ â.â ?
if they fixed you can use string
codeToCompare.Substring(0, 5)
or
Left(codeToCompare, 5)
FORM BANK.xlsx (9.3 KB)
ARR_20230822.xlsx (267.3 KB)
Send you
I see âCustomer codeâ and
âCode(MĂŁ khĂĄch hĂ ng)â
->get left 6 will ok
Hi, canât fix it because some have code C00965-01 (9char)
Oh, I think can use regex
Hi @anh.nguyen
Try this
dtDeposit.AsEnumerable.Where(Function(x) x(0).ToString.TrimEnd(".âc).Equals(codeToCompare.TrimEnd(â."c))).ToArray
It error
Multiple Assign: Can not assign âdtDeposit.AsEnumerable.Where(Function(x) x(0).ToString.TrimEnd(".âc).Equals(codeToCompare.TrimEnd(â."c))).ToArrayâ to âmatchedRowsâ.
Hi @anh.nguyen
Try this:
dtDeposit.AsEnumerable.Where(Function(x) x(0).ToString.Equals(codeToCompare).ToString.TrimEnd("."c)).ToArray
Regards,
It error