Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 3
    Ok. And what have you done this far? Commented Nov 22, 2016 at 11:04
  • Sorry, i added some code Commented Nov 22, 2016 at 11:06
  • Now add directory creation and move files directly to it. Commented Nov 22, 2016 at 11:46
  • But how can i get the folder names {date}? Commented Nov 22, 2016 at 11:51
  • 1
    Use sed (better awk) to pick each component: date="$(awk -F'-|T' '{print $1}' <<< "$f" )" (time and suffix are $2 and $3, respectively). The idea is to pass the string (filename) to awk, set T or - as separators (-F option) and then pick the selected field. With this you can create the dirs. Commented Nov 22, 2016 at 11:55