To know whether its a upper case or not
this expression in IF condition would help you Char.IsUpper(row(“Column3”).toString,row(“Column3”).toString.Length-1)
The 4 lines is 4 transactions data. I’m capturing the bold letter which are the transaction version. I want to know which letter is the upper where :
A = 1
B = 2
C = 3
D = 4
… etc
if i have an A and B version i keep B, if have an A, B and C i keep C, etc…
@BaptisteC
just wait your sample data gave some new insights.
can you give more details e.g on provided datastructures and are there multiple sets to take into account?
we can use the same expression like this Convert.ToChar(row(“Column3”).toString.Substring(5,1))
because the ascii value of A, B, C, D…will be like 65, 66, 67, 68… so with that value we can compare which one is the highest and get that value from the transaction
@BaptisteC
can you please comfirm following: run my xaml as it is, result would be the C Row, does it do the same at your end
Your data provided in the txt is varying in the dataformat structure:
F0 B7 1000 140819FRT3ORDLIV
M2 B7 41087A2000 0 00288000010F00304805D17081923081920081920140819O
M2 B7 41087A4000AD030 4028800001
…
M2 B7 41087A4000TM000 HIGH
M2 B7 41087A3001 0 00354874A500000010000000007720
F0 B7 1000 140819FRT3ORDLIV
If I would assume that 3rd column is to check then values like the first an last row would not match the expected format (e.g. less characters, no letter)
Additional what would be the expected result from your data? the most values (3rd Col) are in the form 41087A3001, there are no so called B values, how to decide whic A row is that one to retrieve
dtSample.AsEnumerable.Select(function ( r ) r(“Column3”).ToString.Substring(0,5)).Distinct().toArray
from 3rd col the substring 0,5 is used, removed the duplicate groups values and store it into an array
dtSample.Clone
transfers the schemainformation dtSample to the other datatable forseen to hold the result data
Within the loop over the groups from above it is calculating the mostupper Letter of all rows belonging to the group:
dtSample.AsEnumerable.Where(Function (row) row(“Column3”).ToString.Substring(0,5).Equals(item)).OrderByDescending(Function (row) row(“Column3”).ToString.Substring(5,1)).First()
where: filtering the group
orderByDecending: Ordering on the Letter (Z-A)
First: taking the first row from result (Thisone with the mostupper letter so C before A …)