[ncl-talk] Help with strings

Prasad, Siva sp4436 at mun.ca
Mon Apr 20 09:41:46 MDT 2015


Hello everyone,

Can anyone please help me with the following problem. I have an ascii
file with two string fields like

 data          field_1          field_2
 0.01     '16-JAN-2003 23:22:20.10'
 0.02     '16-JAN-2003 23:22:25.25'
 0.03     '16-JAN-2003 23:22:30.40'
 0.01     '16-JAN-2003 23:22:35.56'
 0.02     '16-JAN-2003 23:22:40.70'
 0.11     '16-JAN-2003 23:22:45.85'

I want to combine these two fields into one and then find time units
since 01-Jan-2003.   I tried using a do loop to read the strings and
use str_concat to combine them, but it doesn't seem to work

 date = str_get_field(data(1::),  2," ")
 time = str_get_field(data(1::),  3," ")

  do i =0, 5
  strs(i)=(/date(i), time(i)/)
  Pipetime(i) = str_concat(strs(i))
  end do
  print(strs)


Thanks
Siva


More information about the ncl-talk mailing list