Hi Experts,
i want to Count Excel column has 14 digits or not and if not i need to add Zeros before the number. please can any one suggest how can i handle this situation.
Thanks,
Vikram
Hi Experts,
i want to Count Excel column has 14 digits or not and if not i need to add Zeros before the number. please can any one suggest how can i handle this situation.
Thanks,
Vikram
Hey @vikram.g1
You can get the no of digits using the below function:
Math.Ceiling(Math.Log10(yourIntVariable));
Try it and let me know if you are facing any issues.
Cheers!
Hi @monsieurrahul ,
Can i get one example for the above if you donot mind, and also if the digit count is less than 14 i need to add zero’s at starting.
For Ex:
For Column 2,3 and 4 i need to add Zero’s.
Thanks.
Hi ,
can you try this Linq Inside the Invoke Code .
InputDT.Select(“count(Id)<14”).ToList.ForEach(Sub(row) row(“Id”)=row(“Id”).toString.padleft(14,CChar(“0”)))
Hi, another way is Cint(row(“Id”).ToString).ToString(“D14”)
String.padleft(14,”0”C)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.