could I get the string "abc" from a string of "abc.dat" in NCL?

From: LEO_ARIES <Leo_Aries_at_nyahnyahspammersnyahnyah>
Date: Tue, 27 Mar 2007 01:43:36 +0800

hi,all

     I have a small question on the string manipulation in NCL.
     
     Here below is some of my script:

     all_files = systemfunc ("ls " + "*.dat")
     n = dimsizes(all_files)

     do i = 0,n-1
         x =asciiread(all_files(i),-1,"float")
         .....
         wks = gsn_open_wks("eps",all_files(i))
         res = True
         ......
         res_at_gsnLeftString = all_files(i) ? Notice : here is the problem i want to resolve, the last 4 character of the string "all_files(i)"
                                                                    is ".dat", but I don't want them in the resource of "gsnLeftString".
                                                                    Could I have any solution to get all the other character except the ".dat" ?
         plot = .....
     end do

     end

Thanks in advance

Lin
 

LEO_ARIES
2007-03-27

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 26 2007 - 11:43:36 MDT

This archive was generated by hypermail 2.2.0 : Wed Mar 28 2007 - 16:24:59 MDT