[scilab-Users] RE: msscanf

Mike Page Mike at Page-One.Waitrose.com
Wed Jul 4 15:59:09 CEST 2012


Hi,

I think if you do mopen and then mgetl, you will put the lines into Scilab
string variables

Then you can use part and evstr to extract the numerical sections.

for example I made a file a bit like yours and did :

fid=mopen('C:\Temp\tst.txt')
a=mgetl(fid)
 a  =

!GRID     1          05777.6319-69.400954.30913      0  !
!                                                                         !
!GRID     2          15778.6319-69.500954.30914      2  !
!                                                                         !
!GRID     3          25779.6319-69.600954.30915      4  !

evstr(part(a(1),22:30))
 ans  =

    5777.6


HTH,
Mike.


  -----Original Message-----
  From: computidoo [mailto:ychattah at iai.co.il]
  Sent: 04 July 2012 14:32
  To: users at lists.scilab.org
  Subject: [scilab-Users] RE: msscanf


  Sorry but no,

  I fond that if I take only "05777.6319-69.400954.30913      0" and I write

  Msscanf(1,l,'%c %f %f %f %f')

  I get

  0 5777.6319 -69.40095 4.30913 0



  Can I define only to read 4 digit after the point (I tried %.4f and its
not working)






----------------------------------------------------------------------------
--

  From: Adrien Vogt-Schilb [via Scilab / Xcos - Mailing Lists Archives]
[mailto:ml-node+[hidden email]]
  Sent: Wednesday, July 04, 2012 3:26 PM
  To: Yehonatan Chattah
  Subject: RE: msscanf



  Can't you ask patran mesh to produce well formated output?

  On 04/07/2012 14:53, computidoo wrote:

    Like this line(after it) I have around 500 lines so I read each line

    And save the relevant data

    The line came from patran mesh




----------------------------------------------------------------------------

    From: Adrien Vogt-Schilb [via Scilab / Xcos - Mailing Lists Archives]
[[hidden email][hidden email]]
    Sent: Wednesday, July 04, 2012 1:58 PM
    To: Yehonatan Chattah
    Subject: Re: msscanf



    On 04/07/2012 13:52, computidoo wrote:

I have a line that i want to readGRID     1
05777.6319-69.400954.30913      0the problem is that the numbers are
connected.(the line mean GRID 1 0 5777.6319 -69.4009 54.30913   0)I tried
l=mgel(fid,1);Tline=msscanf(1,l,'%s %f %.4f %.4f %.4f %.0f);and i get an
errorBRcomputidoo   Where does the line come from?
    The problem should definitively be fixed upstream





----------------------------------------------------------------------------

    If you reply to this email, your message will be added to the discussion
below:

    http://mailinglists.scilab.org/msscanf-tp4024500p4024501.html

    To unsubscribe from msscanf, click here.
    NAML

    ************************************************************************
***********************

    Please consider the environment before printing this email

    The information contained in this communication is proprietary to Israel
Aerospace Industries Ltd. and/or third parties, may contain confidential or
privileged information, and is intended only for the use of the intended
addressee thereof.

    If you are not the intended addressee, please be aware that any use,
disclosure, distribution and/or copying of this communication is strictly
prohibited. If you receive this communication in error, please notify the
sender immediately and delete it from your computer.

    Thank you.




----------------------------------------------------------------------------

    View this message in context: RE: msscanf
    Sent from the Scilab users - Mailing Lists Archives mailing list archive
at Nabble.com.







----------------------------------------------------------------------------
--

  If you reply to this email, your message will be added to the discussion
below:

  http://mailinglists.scilab.org/msscanf-tp4024500p4024503.html

  To unsubscribe from msscanf, click here.
  NAML



----------------------------------------------------------------------------
--
  View this message in context: RE: msscanf
  Sent from the Scilab users - Mailing Lists Archives mailing list archive
at Nabble.com.

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2012.0.2193 / Virus Database: 2437/5109 - Release Date: 07/03/12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120704/73c98746/attachment.htm>


More information about the users mailing list