Hi, I need help to convert the filenames of my 9-year daily files (1999-2007) from a julian day to yyyy-mm-dd format. my original files are patterned likes the ones below.
Based on the renamed files, I would like to take the average of the values of the 3rd column of the files at 7 days interval for each of the month. The daily files contains sample data like these.
1999001.txt renamed to 19990101.txt
12.3 124.4 2.0
12.1 124.2 1.2
12.4 123.5 1.5
1999002.txt renamed to 19990102.txt
12.3 124.4 1.8
12.1 124.2 2.2
12.4 123.5 1.2
1999003.txt renamed to 19990103.txt ...
12.3 124.4 1.5
12.1 124.2 2.4
12.4 123.5 1.5
1999007.txt renamed to 19990107.txt
12.3 124.4 1.2
12.1 124.2 2.6
12.4 123.5 1.8
hence, in Jan and Feb for instance, I would have resulting averaged files like the ones below:
199901_wk01.txt average of files in Jan 1999 from day 1-7
199901_wk02.txt average of files in Jan 1999 from day 8-14
199901_wk03.txt average of files in Jan 1999 from day 15-21
199901_wk04.txt average of files in Jan 1999 from day 22-28
199901_wk05.txt average of files in Jan 1999 from day 29-31
199902_wk01.txt average of files in Feb 1999 from day 1-7
and so on