Am I stupid?

I’m slowly learning powershell by doing and today I got a little headache while solving a problem I came across:

I have a csv with a date in it which needs to be re-formatted to create a folder which is named after the (newly formatted date)

broken down my problem is as follows:

$datum = "26.03.2019"| %{ $_.Split('.')[2,1,0];} | out-string | %{ $_.replace("`n","")} # I tried to recreate "awk -F . '{print $3$2$1}'" here $datum1 = '20190326' write-host $datum write-host $datum1 write-host $datum.length write-host $datum1.length 

write-host gives me:

20190326

20190326

11

8

I would really appreciate a hint leading to a solution or another way to get from “26.03.2019” to “20190306”.

Thanks in advance

submitted by /u/hhsebastian
[link] [comments]

Leave a Reply