[Scilab-users] Fwd: End of line and tab characters in SCILAB
Dear sir, Could you please let me know the command to detect white spaces such as end of line and tab characters in SCILAB. I tried the "\n" and "\t" respectively but they did not work. Thank you very much. God bless you. -- Samuel Ogbonna Enibe BEng (Nig), MSc (Reading, England), PhD (Nig) Professor of Mechanical Engineering Dean, Faculty of Engineering University of Nigeria, Nsukka, Nigeria Tel: +2348063646798 Email: samuel.en...@unn.edu.ng enibe...@yahoo.com -- Samuel Ogbonna Enibe BEng (Nig), MSc (Reading, England), PhD (Nig) Professor of Mechanical Engineering Dean, Faculty of Engineering University of Nigeria, Nsukka, Nigeria Tel: +2348063646798 Email: samuel.en...@unn.edu.ng enibe...@yahoo.com ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Fwd: End of line and tab characters in SCILAB
Hello, If you are processing strings with only ASCII characters -- with no UTF-8 extensions --, you may use ascii() and then test the presence of ascii(10) for "\n" or ascii(9) for "\t". But the most efficient way is to use a regular expression. In a regexp, EndOfLine is represented with $. As far as i know, it represents either "\n" or "\r" or both. tab is "\t", or any white separator is "\s" (for " ","\t", "\n" or "\r"). May you post your test with "\n" or "\t", with the way you get/generate the string in which you want to detect white spaces? It would help answering to you for your application. Regards Samuel Gougeon Le 10/09/2015 16:39, Samuel Enibe a écrit : Dear sir, Could you please let me know the command to detect white spaces such as end of line and tab characters in SCILAB. I tried the "\n" and "\t" respectively but they did not work. Thank you very much. God bless you. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Fwd: End of line and tab characters in SCILAB
Thank you very much. The string was generated from Excel 2003 files. Some cells contained blank spaces which when processed for use in a LaTeX document or csv file, the blank lines cause errors and had to be removed manually. I tried using the expression datax = strsubst(datax, "\n", " ");//replace EndOfLine with " " everywhere to replace the EndOfLine characters with ordinary spaced but this did not produce the desired results. -- Samuel Ogbonna Enibe University of Nigeria, Nsukka, Nigeria On 9/10/15, Samuel Gougeonwrote: > Hello, > > If you are processing strings with only ASCII characters -- with no > UTF-8 extensions --, you may use ascii() and then test the presence of > ascii(10) for "\n" or ascii(9) for "\t". > But the most efficient way is to use a regular expression. In a regexp, > EndOfLine is represented with $. As far as i know, it represents either > "\n" or "\r" or both. tab is "\t", or any white separator is "\s" (for " > ","\t", "\n" or "\r"). > > May you post your test with "\n" or "\t", with the way you get/generate > the string in which you want to detect white spaces? It would help > answering to you for your application. > Regards > Samuel Gougeon > > Le 10/09/2015 16:39, Samuel Enibe a écrit : >> Dear sir, >> >> Could you please let me know the command to detect white spaces such >> as end of line and tab characters in SCILAB. I tried the "\n" and "\t" >> respectively but they did not work. >> >> Thank you very much. >> >> God bless you. >> > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users