I have this string in this repeating format:
Remit Vendor Vendor Voucher ID Invoice ID Invoice Dt Bus Unit Entered Dt Origin Operator Entry Status Post Status
0000058195 0000058195 01490976 INV-079037 JV 12/31/2021 100GP 2/4/2022
And I need this phrase: 01490976 (all headers from Remit Vendor to Post Status are on one line - Post Status is the final phrase…
I have this but wanting to avoid then doing a second manipulation with a string split at spaces with an index
(?<=(Post Status)+)+\n+(\d\S+)+(\s\d\S+)+
ppr
(Peter Preuss)
March 2, 2022, 10:33pm
2
(?<=Status)(?:(\r?\n)(?:\d+\ ){2})(\d+)
But we would also recommend another technique:
use regex-Replace for setting clear delimiters like |
use both lines within a generate datatable and retrieve the value from resulting datatable
e.g.
@Anand_Designer
Have a look here:
[grafik]
so it is looking for seperator and we should can use it for a replace with e.g. ;
[grafik]
maybe it is better to run the regex pattern seperated
the result we do afterwards feed into the generate datatable activity
assumption: Text file is filtered to only the data block data (Regex, LINQ, … approaches)
DataBlock parsing: we can handle with different approaches (a few of many)
regex pattern on the different column patterns
multistep replacements of many spaces to |
[grafik]
then we do on next step:
[grafik]
and do have a string which can be handled as CSV data
Positional parsing offered by the generate datatable activity
I tried the{2} and didn’t get what I wanted. I will try again. Yes… the idea is to iterate through and add to a dt
ppr
(Peter Preuss)
March 3, 2022, 12:27am
4
No, For 2nd approach
Looking at the header line we do have some more to handle
Looking at the data lines we (e.g. we can skip the first line)
we can insert the good meaning delimiters
then the data lines will be parsed to the datatable when passed to generate datatable activity