<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Siva,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Try this:</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style><div class="gmail_default" style><font face="verdana, sans-serif"> date = str_get_field(data(1::), 2," ")</font></div><div class="gmail_default" style><font face="verdana, sans-serif"> time = str_get_field(data(1::), 3," ")</font></div><div class="gmail_default" style><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style><font face="verdana, sans-serif"> strs = str_sub_str(date + " " + time, "'", "")</font></div><div class="gmail_default" style><font face="verdana, sans-serif"> print(strs)</font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Wei</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><font face="tahoma, sans-serif">================================================</font><div><font face="tahoma, sans-serif">1850 Table Mesa Dr.</font></div><div><font face="tahoma, sans-serif">Boulder, CO 80307</font></div><div><font face="tahoma, sans-serif">Phone: 303-497-8924</font></div></div></div></div>
<br><div class="gmail_quote">On Mon, Apr 20, 2015 at 9:41 AM, Prasad, Siva <span dir="ltr"><<a href="mailto:sp4436@mun.ca" target="_blank">sp4436@mun.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
Can anyone please help me with the following problem. I have an ascii<br>
file with two string fields like<br>
<br>
data field_1 field_2<br>
0.01 '16-JAN-2003 23:22:20.10'<br>
0.02 '16-JAN-2003 23:22:25.25'<br>
0.03 '16-JAN-2003 23:22:30.40'<br>
0.01 '16-JAN-2003 23:22:35.56'<br>
0.02 '16-JAN-2003 23:22:40.70'<br>
0.11 '16-JAN-2003 23:22:45.85'<br>
<br>
I want to combine these two fields into one and then find time units<br>
since 01-Jan-2003. I tried using a do loop to read the strings and<br>
use str_concat to combine them, but it doesn't seem to work<br>
<br>
date = str_get_field(data(1::), 2," ")<br>
time = str_get_field(data(1::), 3," ")<br>
<br>
do i =0, 5<br>
strs(i)=(/date(i), time(i)/)<br>
Pipetime(i) = str_concat(strs(i))<br>
end do<br>
print(strs)<br>
<br>
<br>
Thanks<br>
Siva<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>