; Gets all the information that occur in same date begin dirasc = "./" filasc = systemfunc("cd "+dirasc+" ; ls test.txt") pthasc = dirasc+filasc ;----- Read the values in as 1D array of strings data := asciiread(pthasc,-1,"string") ;----- Open variables y := tointeger( str_get_field(data(1:), 1, "-") ) m := tointeger( str_get_field(data(1:), 2, "-") ) d := tointeger( str_get_field(data(1:), 3, "-") ) lat := tofloat( str_get_field(data(1:), 3, ";") ) lon := tofloat( str_get_field(data(1:), 4, ";") ) pk := tofloat( str_get_field(data(1:), 5, ";") ) locid = tostring(y)+"_"+tostring(m)+"_"+tostring(d) ; create location id string locp = get_unique_values(locid) ; same date location nunq = dimsizes(locp) print("nunq="+nunq) print("======") print(locp) print("======") ;--- Selecting each date at each unique location nLat = new( nunq , typeof(lat), "No_FillValue") nLon = new( nunq , typeof(lon), "No_FillValue") npk = new( nunq , typeof(pk) , "No_FillValue") do i = 0,nunq-1 ; loop over each "same date" locdate := ind(locid.eq.locp(i) ) if (.not.ismissing(locdate(0))) then nLat := str_get_field(locp(i), 3, ";") nLon := str_get_field(locp(i),4,";") npk := str_get_field(locp(i), 5, ";") end if end do ;---- Save to ASCII file with header information (list format): ;-----date;latitude;longitude;pk end