'how to loop thru a file which has starting portition of a file name which is then applied to the remaining portition of file name to create missing
I have over 20,000 data files which have part of the file name that includes the year. The years range from the 1990 to 2020. I used excel to create a list of locations that ignored the repeated names to use as a processing list which reduced down to a total of 1650 total unique locations. Given not all sites have data for every single year I am looking to use the basic list to loop thru the the list of 1650 locations and search for missing years. Once a given year is identified the script will create the needed filename and with fill a default file which is set will all fields as a missing value. I do not have python knowledge and trying to do this thru a bash shell as a do loop.
The input file list looks like....
01-033-0043
01-033-0044
01-033-1002
01-071-0020
what I am attempting to get the script to do is turn that first part of the file name into 01-033-0043-SO2-XXXX.dat.out where the XXXX the range of years 1990 to 2020 and as it loops thru and say the year 2000 is missing it will create that missing file -SO2-2000.dat.out then copy a prefilled file to that file name.
thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
