Hello, I have an excel document to which I must copy the date that has combined with another text, extract the date that comes in Spanish format:
"CORREDORES PERSONA NATURAL MOROSOS AL 20 DE JUNIO DE 2019
I only need the date without the “DE” between each word “DE”
that is to say that it looks like this:
20 JUNIO 2019
to be able to use it as datetime and then use the dates, It is important to mention that dates are dynamic, change date, but keep the same structure
Now do the following: extract the text as a variable but I can not perform a regex to extract the date that is in the following format, DateTime.now.toString (dd MMMM yyyy). The problem is that when using REGEX, I can not identify the correct structure to extract the date, and try to:
^ ([0-2] [0-9] | (3) [0-1]) (\ /) (((0) [0-9]) | ((1) [0-2])) ( \ /) \ d {4} $
(? n: ^ (? = \ d) ((? (0? [13578]) | 1 [02] | (0? [469] | 11) (?!. 31) | 0? 2 ( ? (.29) (? =. 29. ((1 [6-9] | [2-9] \ d) (0 [48] | [2468] [048] | [13579] [26]) | ( 16 | [2468] [048] | [3579] [26]) 00)) | (?!. 3 [01]))) (? [-. /]) (? 0? [ 1-9] | [12] \ d | 3 [01]) \ k (? (1 [6-9] | [2-9] \ d) \ d {2}) (? (? = \ x20 \ d) \ x20 | $))? (? ((0? [1-9] | 1 [012]) (: [0-5] \ d) {0.2} (? i: \ x20 [AP] M)) | ([01] \ d | 2 [0-3]) (: [0-5] \ d) {1,2})? $)
Anyone have any ideas ?, Since I can divide the roof with the split, and just leave it like this: 20 JUNIO 2019
Update 25/6719
I could solve it, before they answered me but I think that is exactly what you answered me, what I did was the following:
use activity-> Split String
in the Input place “the variable”, in the Result “the output variable” then with the Assing activity, place "the variable that leaves the RESULT of the split example:
variable (5) + variable (7) + variable (9),
so that in the “assign” I threw the data 20JUNIO2019 ← but now I have those as a STRING, but I want to convert it to DATETIME, I’m trying but I can not convert it, I get error error,
I am using this sentence:
NewValueDateString = Convert.ToDateTime (“”) (“ddMMMMyyyy”). ToString) .Date
DateTime.ParseExact (convertedDate.ToString (“dd / mm / yy”), “dd / mm / yy”, Nothing) .ToString (“MM / dd / yyyy”).
you will know if you can help me, convert the string 20JUNIO2019 → DateTime
Of course, taking into account that the string 20JUNIO2019, the date changes since the name is dynamic, but always keep the structure ddMMMMyyyy
Now I need to convert in dd-mm-yyyy example: 06-20-2019