[Scilab-users] Fwd: End of line and tab characters in SCILAB

Samuel Enibe samuel.enibe at unn.edu.ng
Thu Sep 10 23:14:37 CEST 2015


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 Gougeon <sgougeon at free.fr> wrote:
> 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 at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>



More information about the users mailing list