I am struggling to convert a textfile which contains the string:
10.04.2015 12:00:15 to
150410 The date will always be the date format but is taken from a textfile so as far as I know I can't use a date command and I think I must use awk but I don't know it well and am struggling - advice would be appreciated?
awk '{ print substr($0, 7, 2) substr($0, 3, 2) substr($0, 1, 2) }'but realistically, we need to understand what else there is in the file. Show us a real representative sample input and the desired output.date -d"10/04/2015 12:00:15" "+%y%d%m"makes it.