Rainer M Krug
2015-Jan-22 13:32 UTC
[R] cat() and \r et al. escape sequences - are there more?
Hi I just discovered \r and \t --8<---------------cut here---------------start------------->8---> cat(LETTERS, "\n")A B C D E F G H I J K L M N O P Q R S T U V W X Y Z>--8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8---> cat(LETTERS, "\r", letters, "\n")a b c d e f g h i j k l m n o p q r s t u v w x y z> >--8<---------------cut here---------------end--------------->8---and \a as alert \b as backspace \f as form-feed \n as newline \r as carriage-return \t as tab \v as vertical-tab are there more of these escape sequences? Especially, Can I position the cursor at a specific column? I would like to do this to show progress in an analysis done with mclapply() on multiple cores and, preferably, display each core (7) at a fixed position in a line. Thanks, Rainer -- Rainer M. Krug email: Rainer<at>krugs<dot>de PGP: 0x0F52F982 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 494 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150122/c209c699/attachment.bin>
Prof Brian Ripley
2015-Jan-22 14:11 UTC
[R] cat() and \r et al. escape sequences - are there more?
See ?Quotes. On 22/01/2015 13:32, Rainer M Krug wrote:> Hi > > I just discovered \r and \t > > --8<---------------cut here---------------start------------->8--- >> cat(LETTERS, "\n") > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z >> > --8<---------------cut here---------------end--------------->8--- > > --8<---------------cut here---------------start------------->8--- >> cat(LETTERS, "\r", letters, "\n") > a b c d e f g h i j k l m n o p q r s t u v w x y z >> >> --8<---------------cut here---------------end--------------->8--- > > and > \a as alert > \b as backspace > \f as form-feed > \n as newline > \r as carriage-return > \t as tab > \v as vertical-tab > > are there more of these escape sequences? > > Especially, Can I position the cursor at a specific column? I would like > to do this to show progress in an analysis done with mclapply() on > multiple cores and, preferably, display each core (7) at a fixed > position in a line.How these are interpreted is a matter for the terminal/console. Some terminals have escape sequences to do that, but most consoles do not.> > Thanks, > > Rainer > > > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK
Prof Brian Ripley
2015-Jan-22 14:29 UTC
[R] cat() and \r et al. escape sequences - are there more?
On 22/01/2015 14:22, Rainer M Krug wrote:> > > Envoy? de mon iPhone > >> Le 22 janv. 2015 ? 15:11, Prof Brian Ripley <ripley at stats.ox.ac.uk> a ?crit : >> >> See ?Quotes. > > Perfect - thanks. > >> >>> On 22/01/2015 13:32, Rainer M Krug wrote: >>> Hi >>> >>> I just discovered \r and \t >>> >>> --8<---------------cut here---------------start------------->8--- >>>> cat(LETTERS, "\n") >>> A B C D E F G H I J K L M N O P Q R S T U V W X Y Z >>>> >>> --8<---------------cut here---------------end--------------->8--- >>> >>> --8<---------------cut here---------------start------------->8--- >>>> cat(LETTERS, "\r", letters, "\n") >>> a b c d e f g h i j k l m n o p q r s t u v w x y z >>>> >>>> --8<---------------cut here---------------end--------------->8--- >>> >>> and >>> \a as alert >>> \b as backspace >>> \f as form-feed >>> \n as newline >>> \r as carriage-return >>> \t as tab >>> \v as vertical-tab >>> >>> are there more of these escape sequences? >>> >>> Especially, Can I position the cursor at a specific column? I would like >>> to do this to show progress in an analysis done with mclapply() on >>> multiple cores and, preferably, display each core (7) at a fixed >>> position in a line. >> >> How these are interpreted is a matter for the terminal/console. Some terminals have escape sequences to do that, but most consoles do not. > > You don't know by any chance if terminal on Yosemite has these?Depends what terminal you set it to emulate, but likely yes. See e.g. http://www.termsys.demon.co.uk/vtansi.htm .> > Thanks, > > Rainer > >> >>> >>> Thanks, >>> >>> Rainer >>> >>> >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> >> -- >> Brian D. Ripley, ripley at stats.ox.ac.uk >> Emeritus Professor of Applied Statistics, University of Oxford >> 1 South Parks Road, Oxford OX1 3TG, UK-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK
Rainer M Krug
2015-Jan-22 15:07 UTC
[R] cat() and \r et al. escape sequences - are there more?
Envoy? de mon iPhone> Le 22 janv. 2015 ? 15:29, Prof Brian Ripley <ripley at stats.ox.ac.uk> a ?crit : > >> On 22/01/2015 14:22, Rainer M Krug wrote: >> >> >> Envoy? de mon iPhone >> >>> Le 22 janv. 2015 ? 15:11, Prof Brian Ripley <ripley at stats.ox.ac.uk> a ?crit : >>> >>> See ?Quotes. >> >> Perfect - thanks. >> >>> >>>> On 22/01/2015 13:32, Rainer M Krug wrote: >>>> Hi >>>> >>>> I just discovered \r and \t >>>> >>>> --8<---------------cut here---------------start------------->8--- >>>>> cat(LETTERS, "\n") >>>> A B C D E F G H I J K L M N O P Q R S T U V W X Y Z >>>>> >>>> --8<---------------cut here---------------end--------------->8--- >>>> >>>> --8<---------------cut here---------------start------------->8--- >>>>> cat(LETTERS, "\r", letters, "\n") >>>> a b c d e f g h i j k l m n o p q r s t u v w x y z >>>>> >>>>> --8<---------------cut here---------------end--------------->8--- >>>> >>>> and >>>> \a as alert >>>> \b as backspace >>>> \f as form-feed >>>> \n as newline >>>> \r as carriage-return >>>> \t as tab >>>> \v as vertical-tab >>>> >>>> are there more of these escape sequences? >>>> >>>> Especially, Can I position the cursor at a specific column? I would like >>>> to do this to show progress in an analysis done with mclapply() on >>>> multiple cores and, preferably, display each core (7) at a fixed >>>> position in a line. >>> >>> How these are interpreted is a matter for the terminal/console. Some terminals have escape sequences to do that, but most consoles do not. >> >> You don't know by any chance if terminal on Yosemite has these? > > Depends what terminal you set it to emulate, but likely yes. See e.g. http://www.termsys.demon.co.uk/vtansi.htmThanks - exactly the information I was looking for. I'll give feedback if I get it to work. Thanks, Rainer> >> >> Thanks, >> >> Rainer >> >>> >>>> >>>> Thanks, >>>> >>>> Rainer >>>> >>>> >>>> >>>> ______________________________________________ >>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>> https://stat.ethz.ch/mailman/listinfo/r-help >>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >>>> and provide commented, minimal, self-contained, reproducible code. >>>> >>> >>> >>> -- >>> Brian D. Ripley, ripley at stats.ox.ac.uk >>> Emeritus Professor of Applied Statistics, University of Oxford >>> 1 South Parks Road, Oxford OX1 3TG, UK > > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Emeritus Professor of Applied Statistics, University of Oxford > 1 South Parks Road, Oxford OX1 3TG, UK