I tried something similar as above. However, the quantity isn’t showing up. even after i validated with it like 3 times. anything i missed out?
“_text”: “(Daily File) Jun 2018 119 GB(s)”,
It seems here you are trying to use a sledgehammer to crack a nut.
I’m not sure why the use of wit.ai is required (as interesting as it is). It seems that the format is pretty consistent e.g. (Daily File) MMM 2018 therefore some basic string manipulation and/or regex should do the trick here.
I did try regex.
Try this one instead:
It will find all numbers after 2018. It is very basic, but can be improved to take more conditions into account.
The full expression that returns a String with your numbers looks like this:
System.Text.RegularExpressions.Regex.Match("(New Paper) Aug 2018 119 KG(s)", "(?<=2018 )\d+").ToString
See a slightly improved example here.
I am getting this texts to a datatable. Thus, Is there any function where if there nothing behind 2018, just add space?
Could you specify what the issue is? I think something is missing in your last post.
If the problem is to not be able to match something, you can extend the Regex to include more possibilities, see here.
Basically, this text is (New Paper) Aug 2018 119 KG(s) is in an array of strings. I am seperating each row into a column. Either 01 Jun 2018 to 30 Jun 2018 or (New Paper) Aug 2018 119 KG(s) will be in the array. I just want to get the value after 2018 and put it into another column. If there is nothing after 2018, add a space
In the case of string
01 Jun 2018 to 30 Jun 2018
regex will not find anything, so you could base your workflow on the empty match (IF match is empty, then do space, otherwise the found number)