Number Formats - Range of Numbers

Hi Team,

I have a inputs such as
12/7(1-3)
10/12(6-8)
1/3(5-9)
1/17(1-2)

and I would like to get the output as
12/07(1),12/07(2),12/07(3)

10/12(6),10/12(7),10/12(8)

01/03(5),01/03(6),01/03(7),01/03(8),01/03(9)

01/17(1),01/17(2)

Kindly help me out to solve this

Thanks in Advance

1 Like

@manikandan.murugan

Try like this

I hope the input is of stirng type…use below in assign output variable type is arrya of string…stringvalue is the place where you need to replace the actual variable

ArrayofValues = Enumerable.Range(0, Cint(System.Text.RegularExpressions.Regex.Match(stringvalue,"(?<=\-)\d+").Value)).Select(function(x) stringValue.Split("("c).First + "(" + (Cint(System.Text.RegularExpressions.Regex.Match(stringvalue,"\d+(?=\-)").Value) + x).ToString + ")").ToArray

Cheers

1 Like


I tried and it shows an error in the attached image

1 Like

Hi,

Can you try the following sample?

intStart = CInt(system.Text.RegularExpressions.Regex.Match(yourString,"(?<=\()\d+").Value)
intNumber = CInt(system.Text.RegularExpressions.Regex.Match(yourString,"\d+(?=\))").Value)-intStart+1

Then

arrStr = Enumerable.Range(intStart,intNumber).Select(Function(i) System.Text.RegularExpressions.Regex.Match(yourString,"[^(]+").Value+"("+i.ToString+")").ToArray()

Sample
Sample20240316-3a.zip (2.6 KB)

Regards,

2 Likes

@manikandan.murugan,

Try this one.

Code:
NumberFormat.xaml (10.5 KB)

Output:
image

Thanks,
Ashok :slight_smile:

2 Likes

Thanks @Yoichi for your help

1 Like

Thanks @ashokkarale for your help

2 Likes

@manikandan.murugan

You can add it in importa and it should work

Cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.