Search Pattern with ⎕UCS 13
3 posts
• Page 1 of 1
Search Pattern with ⎕UCS 13
What would be the proper way to change all the carriage return (⎕UCS 13) of a vector of character while using ⎕R. I have tried the following but it is not working:
Thanks in advance
- Code: Select all
((⎕ucs 13) ⎕R '\ ') 'first line',(⎕ucs 13),'second line'
('\r' ⎕R '\ ') 'first line',(⎕ucs 13),'second line'
Thanks in advance
-
PGilbert - Posts: 436
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: Search Pattern with ⎕UCS 13
Hi Pierre,
⎕S/R work in Line mode (the default) and Document mode.
In Line mode each line is treated individually as if they were split on CRs.
In document mode every character is visible and can be acted upon.
There is more to it but to answer your problem use the Document Mode variant:
⎕S/R work in Line mode (the default) and Document mode.
In Line mode each line is treated individually as if they were split on CRs.
In document mode every character is visible and can be acted upon.
There is more to it but to answer your problem use the Document Mode variant:
- Code: Select all
((⎕ucs 13) ⎕R '\ '⍠'Mode' 'D') 'first line',(⎕ucs 13),'second line'
first line second line
- DanB|Dyalog
Re: Search Pattern with ⎕UCS 13
Many thanks Daniel it worked perfectly. For the benefits of everybody here is the resulting DFN that can be used to change the characters that are not allowed in xml (when not using ⎕XML that does it automatically):
- Code: Select all
{((⎕UCS 13) ⎕R '\ ' ⍠ 'Mode' 'D')('<' ⎕R '\<')('>' ⎕R '\>')('&' ⎕R '\&')⍵}
-
PGilbert - Posts: 436
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group