<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Hi<br><br> I have clean up a little bit your program.. it had a couple of errors, specially with quotes and froward/backlash usage..<br><br>Please take a look .. maybe we can proceed from this point an on...<br><br>Julio<br><br><br>clear<br>clc<br><br>strMrVarNames =['Curent';'Power';'Torque';'Presure';'Angle'];<br>strMrValues = ["";"";"";"";""];<br>[txt]=mgetl('D:\vals.txt'); //get all lines<br>txt<br>iNrOfLines=size (txt,1);<br>iNrOfLines1=size(strMrVarNames,1);<br><br>for i=1:iNrOfLines<br> //if we have \ '/\'<br> if strindex( txt(i),'/') == 1 then<br> A=(tokens(txt(i),[':'])); //Splits text in 2 coloms (value and name)<br> //A(1,$); //gives the value<br> //A($,1); //gives the
variable<br> Name=A(1,$);<br> Value=A($,1);<br> for j=1:iNrOfLines1<br> if strcmp(Name,strMrVarNames(j)) then<br> disp('OK')<br> strMrValues=Value;<br> else strMrValues(i)='NULL';<br> end//if<br> end//for<br> end //if<br>end<br>strMrValues<br>strMrVarNames <br><div><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Sylvestre Ledru
<sylvestre.ledru@scilab.org><br><b><span style="font-weight: bold;">To:</span></b> users@lists.scilab.org<br><b><span style="font-weight: bold;">Sent:</span></b> Fri, 16 April, 2010 9:50:08<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [scilab-Users] petrialucian@yahoo.com sent you the following files : notepad.exe<br></font><br>Please, could you avoid sending email with notepad.exe, your email are<br>hard to read on some mailers.<br><br>Thanks<br>Sylvestre<br><br><br>Le vendredi 16 avril 2010 à 10:36 +0300, transfer.ro a écrit :<br>> Transfer.ro <br>> <a ymailto="mailto:petrialucian@yahoo.com" href="mailto:petrialucian@yahoo.com">petrialucian@yahoo.com</a> ti-a trimis<br>> fisiere folosind Transfer.ro<br>> impreuna cu urmatorul mesaj:<br>> <br>> <br>> <a ymailto="mailto:petrialucian@yahoo.com" href="mailto:petrialucian@yahoo.com">petrialucian@yahoo.com</a> has sent you<br>> some files using Transfer.ro
with<br>> the following message:<br>> <br>> <br>> Pls Help me with this program. What<br>> i want to do is :<br>> I have 1 txt file that looks like<br>> this :<br>> /Curent : 99<br>> /Power : 12345<br>> /Name : ABCDEF<br>> /Presure : 991234<br>> /Name1 : dfmne<br>> -------------------------<br>> 12345<br>> 678910<br>> -111213<br>> -141516<br>> -171819<br>> <br>> And i what to process the<br>> information. So if i enter from the<br>> keyboard Curent the program should<br>> show me it\'s value, that is \"99<br>> \"...and soo on. Thenumbers below<br>> the \"-----------\" should be in 2<br>> vectors, one V1 for positive nr and<br>> V2 for negative. I made this for a<br>> startes but it doesn\'t work :( .<br>> Pls give me some hints soo and cand<br>> get on with it ! TKS A LOT<br>> <br>> ///<br>> strMrVarNames =[\"Curent\";\"Power<br>>
\";\"Torque\";\"Presure\";\"Angle<br>> \"];<br>> strMrValues = [\"\";\"\";\"\";\"\";<br>> \"\"];<br>> [txt]=mgetl(\'Var_fin.txt\'); //get<br>> all lines<br>> iNrOfLines=size (txt,1);<br>> iNrOfLines1=size(strMrVarNames,1)<br>> for i=1:iNrOfLines<br>> txt(i);<br>> //if we have \ '/\'<br>> if strindex( txt(i),\'/\') == 1<br>> then<br>> <br>> A=(tokens(txt(i),[\'/\',\':<br>> \']))\'; //Splits text in 2 coloms<br>> (value and name)<br>> //A(1,$); //gives the value<br>> //A($,1); //gives the variable<br>> <br>> Name=A($,1)<br>> Value=A(1,$);<br>> for j=1:iNrOfLines1<br>> val;<br>> strMrVarNames(j);<br>> if<br>> strcmp(Name,strMrVarNames(i,j))==1<br>> then<br>> disp(\"OK\")<br>> strMrValues=Value;<br>> else strMrValues(i)=\"null\";<br>> <br>> end//if<br>> end//for<br>> end //if<br>> end<br>> strMrValues<br>> strMrVarNames<br>> <br>> Fisierele
care ti-au fost<br>> transferate sunt <br>> notepad.exe<br>> Click pe linkul de mai jos pentru a<br>> le downloada: <br>> Click on the link below to download<br>> the files: <br>> <a href="http://www.transfer.ro/storage/transfer_ro-16Apr-6fea271b8c.zip" target="_blank">http://www.transfer.ro/storage/transfer_ro-16Apr-6fea271b8c.zip</a><br>> Fisierele vor fi sterse automat<br>> dupa 10 zile.<br>> The files will be deleted<br>> automaticaly after 10 days.<br>> Pentru a salva fisierele in<br>> calculator click iar apoi alegeti'<br>> Save AS'<br>> Transfer.ro este un serviciu<br>> profesional securizat care permite<br>> transferul de fisiere mari (pana la<br>> 1GB) catre orice adresa de e-mail. <br>> <br>> Pentru sugestii,probleme sau<br>> feedback ne puteti contacta la<br>> <a ymailto="mailto:simina@transfer.ro" href="mailto:simina@transfer.ro">simina@transfer.ro</a> sau telefonic<br>>
Luni-Vineri intre orele 10-18 la<br>> 031-710.10.73 <br>> <br>> <br>> <br>> <br>12345<br>678910<br>-111213<br>-141516<br>-171819<br><br>And i what to process the information. So if i enter from the keyboard<br>Curent the program should show me it\'s value, that is \"99\"...and soo<br>on. Thenumbers below the \"-----------\" should be in 2 vectors, one V1<br>for positive nr and V2 for negative. I made this for a startes but it<br>doesn\'t work :( . Pls give me some hints soo and cand get on with it !<br>TKS A LOT<br><br>///<br>strMrVarNames =[\"Curent\";\"Power\";\"Torque\";\"Presure\";\"Angle\"];<br>strMrValues = [\"\";\"\";\"\";\"\";\"\"];<br>[txt]=mgetl(\'Var_fin.txt\'); //get all lines<br>iNrOfLines= size (txt,1);<br>iNrOfLines1=size(strMrVarNames,1)<br>for i=1:iNrOfLines<br>txt(i);<br>//if we have \'/\'<br>if strindex( txt(i),\'/\') == 1 then<br><br>A=(tokens(txt(i),[\'/\',\':\']))\'; //Splits text in 2 coloms (value
and<br>name)<br>//A(1,$); //gives the value<br>//A($,1); //gives the variable<br><br>Name=A($,1)<br>Value=A(1,$);<br>for j=1:iNrOfLines1<br>val;<br>strMrVarNames(j);<br>if strcmp(Name,strMrVarNames(i,j))==1 then<br>disp(\"OK\")<br>strMrValues=Value;<br>else strMrValues(i)=\"null\";<br><br>end//if<br>end//for<br>end //if<br>end<br>strMrValues<br>strMrVarNames<<<br><br></div></div>
</div><br>
</body></html>