필터 지우기
필터 지우기

date format in parseDirListingForUnix in R2021b

조회 수: 4 (최근 30일)
Rafael
Rafael 2022년 10월 18일
답변: Rafael 2024년 3월 14일
Hi Experts,
I got a result from my "dir" to my sftp with ServerLocale de_DE but it cant parse files with dates from beginning of months.
C:\Program Files\MATLAB\R2021b\toolbox\matlab\io\ftp\+matlab\+io\+ftp\parseDirListingForUnix.m errors due to
makeDate = "1-Okt-2022 00:10:00" which does not fit the format "dd-MMM-yyyy HH:mm:ss"
I see I cant change that code and cant change the server output.
Any suggestions? Thanks, Rafael

채택된 답변

Rafael
Rafael 2024년 3월 14일
that works for me now:
add a custom parser function with name value pair in sftp call
"DirParserFcn", @myCustomDirParser
and within this transform the given date information into a format accepted by datetime function, see also https://de.mathworks.com/matlabcentral/answers/1602180-problem-with-datetime-in-german

추가 답변 (1개)

Piyush Dubey
Piyush Dubey 2023년 5월 30일
Hi Rafael,
To parse the date in a particular format, a shell script can be used in post processing the data just before the output is generated from the server in a Unix environment.
A pre-processing script or MATLAB function maybe used before performing further computations on data at the recipient server. “datestr” might be helpful.
Follow this documentation to learn more about “datestr”:
Hope this helps.
  댓글 수: 1
Rafael
Rafael 2024년 3월 14일
thanks for the suggestion, but I think this is out of range for me since I have no control over the server myself. I did work out a customDirParser function with help of mathworks support. thats fine now.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by