HI All,
I want to convert column (L, M, N, O, P, Z, AA ) date to UK time (dd/mm/yyyy) and add 12,4,6 to date on column (M ) based on the value in the column (R).
This is CSV file and need to save output also to a CSV file.
Thanks for your support.
HI All,
I want to convert column (L, M, N, O, P, Z, AA ) date to UK time (dd/mm/yyyy) and add 12,4,6 to date on column (M ) based on the value in the column (R).
This is CSV file and need to save output also to a CSV file.
Thanks for your support.
@MDias
Parsing a String
YourDateTimeVariable = DateTime.ParseExact(YourDateStringVariable, “dd/MM/yyyy”, new CultureInfo(“en-GB”))
Adding 6 days:
YourDateTimeVariable.AddDays(6)
I’ve attached CSV file.( I have more than 10000 records in the original file)
1.I need to convert column date ( L,M,N,O,P,Z,AA) to dd/mm/yyyy
2.Then i need to calculate column S (Free Time) based on the value on Column Q ( Carrier)
If Column Q =
APLL add 12 days to ETA (Column L)
APL add 6 days to ETA (Column L)
CMA add 4 days to ETA (Column L)
3.Need to save file as CSV
Hope this gives more information.
Thanks in advance Data.7z (688 Bytes) for helping.
@MDias
PFA Sample CSVDateAddMDias.xaml (7.3 KB)
I did some Kickstarter for you. Remaining tasks you should complete by yourself.
Kindly note: some Date Columns maybe need no conversion or a logic to detect which format is applied.
@ppr still it’s not converting as expected.
CSV file saved as mm/dd/yyyy and need to convert to dd/mm/yyyy
@MDias Kindly Note:
To change the date format, use the following logic (you have like 80% of the code already)
read date as string → parse it into a dateTime → write that dateTime using toString(Here specify your new date format )
As an example: you have 05/28/2019 in your csv
12/28/2019 → parse it in a dateTime variable (let’s call it date1) → write in that cell date1.tostring(“dd/MM/yyyy”)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.