I'm trying to extract dates from a .nc file and I wanted to write a script to automate the process by using a .txt file, the data looks like this:
1995 04 05
1995 06 12
1995 06 30
1995 07 16
1995 07 19
1995 07 20
1995 07 28
1996 03 09
1996 04 25
1996 08 13
I want to assign a variable for years, months and days separately e.g. , so that It would take the date from each line as input it in a command like this:
cdo seltimestep,$DD "mon_$MM.nc" "/Desktop/2020/output/$YYYY-$MM-$DD.nc"
I previously made a script similar to this but I had to input each date manually.