Carriage return without new line

435 views
Skip to first unread message

RecentConvert

unread,
Apr 23, 2014, 4:00:50 AM4/23/14
to julia...@googlegroups.com
I would like to periodically output a progress percentage but don't want a huge list of numbers cluttering the rest of the outputs. How can this be accomplished?

print("hello")
print("\rworld")


This doesn't work because \r adds a new line.

Andreas Noack Jensen

unread,
Apr 23, 2014, 4:05:08 AM4/23/14
to julia...@googlegroups.com
Not on my machine

julia> print("hello");print("\rworld!")
world!

Which operation system and which version of Julia are you running?
--
Med venlig hilsen

Andreas Noack Jensen

RecentConvert

unread,
Apr 23, 2014, 4:35:09 AM4/23/14
to julia...@googlegroups.com
Julia Version 0.2.1
Commit e44b593* (2014-02-11 06:30 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)

Windows 7

Tobias Knopp

unread,
Apr 23, 2014, 4:54:12 AM4/23/14
to julia...@googlegroups.com
I can confirm this behavior under 0.3 prerelease on windows. The following works however

julia> print("hello");print("\b\b\b\b\bworld!")
world!

I think this should be filed as an issue at https://github.com/JuliaLang/julia

RecentConvert

unread,
Apr 23, 2014, 5:39:48 AM4/23/14
to julia...@googlegroups.com
print("hello");print("\b\b\b\
b\bworld!"
)


This works in the basic terminal but not in Julia Studio.

Tobias Knopp

unread,
Apr 23, 2014, 5:57:15 AM4/23/14
to julia...@googlegroups.com
Julia Studio is an entirely different issue as they might have implemented their own REPL (terminal).
The issue should be reported here: https://github.com/forio/julia-studio/issues.

Tim Holy

unread,
Apr 23, 2014, 6:22:25 AM4/23/14
to julia...@googlegroups.com
Pkg.add("ProgressMeter")

--Tim

Tobias Knopp

unread,
Apr 23, 2014, 6:28:40 AM4/23/14
to julia...@googlegroups.com
Awesome! Did not know that.
Reply all
Reply to author
Forward
0 new messages