Hello all,
I want to extract this date from pdf , and i am using data labeling , when i select it it gives me the string that i did nit need
when i declared it as date , in ml extractor there is error and in data labeling display(2022-01-22
thank you for help
Hi @nora_ziani,
Did you convert from string to datetime right?
like: DateTime.ParseExact(dateStr,“dd-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture)
I must get it as String in data labeling and machine extractor
after that i must convert it and disp?
If you get it as string in this format 31-JAN-22 it is better to convert string to date after.
my problem i want to add also the hour 05:00
2022-04-26T10:00:00 like this as example
So your extracted string looks like 31-JAN-22 05:12? Or you have to extract seperately?
2022-04-26T10:00:00 like this
First
Assign
ExtractedString = extractedString.Replace(“T”, “ “)
Second
Assign
ExtractedDatetime as Datetime = datetime.ParseExact(extractedString, (“yyyy-MM-dd HH:mm:ss”, system.Globalization.Cultureinfo.InvariantCulture)
Hi! @nora_ziani,
Follow the steps to achieve your requirement!
- Read the pdf using read pdf activity store it in a variable.
- Use the regular expression to get the date.
- Make sure You have imported the namespaces System.Text.RegularExpressions from the Import pannel.
System.Text.RegularExpressions.Regex.Match(PDFOutput,"(?<=From:).*(?= )").ToString
Reference:
Regards,
NaNi