I have to get each network nodes global title number range in for each loop using regex
If I get network global title number range in first loop like
First loop output:
91 7001
91 7001
Second loop output:
91 7002
91 7002
Please help
I have to get each network nodes global title number range in for each loop using regex
If I get network global title number range in first loop like
First loop output:
91 7001
91 7001
Second loop output:
91 7002
91 7002
Please help
Please help anyone ![]()
Thanks
Shaik
just share with us the sample as text / text file
Try this c# code
// Read input text file and split into lines
string lines = File.ReadAllLines(“input.txt”);
// Process each line
var groupedOccurrences = lines
.Select(line => line.Split(’ ')) // Split each line by space
.SelectMany(parts =>
{
string nameOrNumber = parts[0]; // Get the first part (name or number)
string number = parts.Last(); // Get the last part (numeric part)
return nameOrNumber == “Network Nodes Global Title Number Range(s)” ? new { number } : Enumerable.Empty(); // Filter only numbers associated with “Network Nodes Global Title Number Range(s)”
})
.GroupBy(number => number) // Group by the numeric part
.Select(group => $“{group.Key} - occurrence {group.Count()}”); // Format output
// Write output to a DataTable
DataTable dataTable = new DataTable();
dataTable.Columns.Add(“Output”, typeof(string));
foreach (var occurrence in groupedOccurrences)
{
dataTable.Rows.Add(occurrence);
}
// Now you can use the ‘dataTable’ variable in UiPath
Sample.txt (705.5 KB)
We can use / combine different strategies:
For regex we can apply the divide and conquer principle:
Extract Blocks:
(?<=Network Nodes .+\n)[\s\S]+?(?=\n\D)
Extract from block:
^\d+\ \d+
can you provide sample workflow please with each loop using regex
thanks
shaik
@Parvathy In my requirement another for each loop will run that time I have to fetch only first network nodes global title in first loop
Ex:
My another loop value TADIG code: AUTHU (Suppose this tadig contain two global titles(
My result have to get like
AUTHU 91 7019
AUTHU 91 7019
Next loop value TADIG code: AKTBY
AKTBY 91 7012
AKTBY 91 7012
Thanks
Shaik
Thank you sooo much @Yoichi its working fine ![]()
Can you give title with below numbers in string variable with regex expression
Can you share fixed string and result string?
@Yoichi If you don’t mind please run this sample text
Sample.txt (37.5 KB)
result printed wrongly…there Two tadigs but only one tadig feed in excel
please can you try
thanks
shaik
Instead of Section ID can you take other one in regular expression
@Yoichi can you explain why you take Section ID in regular expression
Hi,
I thought SectionId is a proper unit to seprate the text.
If it’s no proper, can you share proper one.
Regards,
@Yoichi Can you try this sample text
Sample.txt (37.5 KB)
Can you get Network name with regex
am trying but not write in excel please help
Sample (1).txt (19.9 KB)