I am trying to take lines from a .txt file that has 15 columns, and subset out a certain range of lines and then write them in one long column. The text file represents a lattitude/longitude grid that puts a band of latittude in 24 lines, 15 columns and I'm trying to get a certain area. If i can read the band of latitude in a column I can grab the areas by their longitude.
My text file looks like:
1 2 3 4 ... 15
16 17 18 etc
and needs to look like:
here's part of the code:
LatCount = 1
DayFile = open('F:/SRB/srb_rel2.5_qclw_daily-1995-2005/test/lw_subsets/'+InFilename+'_'+Day+'.txt', 'r')
LatFile= open('F:/SRB/srb_rel2.5_qclw_daily-1995-2005/test/lw_subsets/'+InFilename+'_'+Day+'_'+LatStart+'-'+LatEnd+'.txt', 'w')
for line in DayFile:
if LatCount >=LatStartLine and LatCount <= LatEndLine:
It's writing the file just fine. I just can't figure out the easiest way to read it into a single column.