i am working on a project where i am using regex to extract data from text files and then writing that value to a datatable
i can work with the data if there is no comma, or if there are 2 or more digits after the comma
i have an issue though if the data i am extracting has only one digit after a comma
the value is coming out as 1273 but it should be 1273.5
ideally i would like to count the number of comma’s (if any) in the string and then write a switch based on what should happen then
no comma eg 123 report 123
1 comma eg 321.6 report 321.6 or 321.60 just not 321 as is currently being reported
2 or more commas eg 568.8765432 report 568.87
the work flow is attached, along with a few text files that i used as well
It looks like the value parsing of number in French close culture is needed
e.g. Valeur Liquidative (VL) : 1 273,5 ( USD) as space is used as a group seperator
in general we can do it by
And can also reformat e.g. like
For catching the number we can use Regex and also extend it. Just a starter partern focussing on French Formats
\d[\d ]*[,\d]*
For sure we can tune and adapt the pattern
thanks fo the help. tried this and it worked ok. i did have to make one minor change. i had to add an if statment to see if a value was left blank. if it was blank i put in a value like N\A just so as it would be reported on.