Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: text file line-end characters in mixed linux /os X / windows environments

From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: text file line-end characters in mixed linux /os X / windows environments
Date   Sat, 1 Jan 2011 10:39:46 +0000

It's arguable whether WordPad is a text editor. I see it rather as a
primitive word processor whose functionality includes saving as plain
text (ASCII). But that's just a small question of terminology.

How does the Viewer in Windows Stata work with logs generated on other

How does Stata's do-file editor -doedit- work?

I routinely use -doedit- to look at ado and do files sent to me by
people using all the different platforms supported by Stata, or to
hack at code or data fragments included in Statalist postings. I've
not noticed problems with end-of-lines.

Alternatively, there are several text editors up to the job. My own
favourite Vim would do, but your colleagues might not appreciate the
need to learn some Vim, which at first sight is very odd, unless your
previous editor was ed or ex, most unlikely in 2011!

Nick Cox

On Fri, Dec 31, 2010 at 11:01 PM, Kevin Geraghty <[email protected]> wrote:

> I have a small garden-variety mixed-computing-environment problem, and am wondering if there is anything internal to stata which can be used to solve it. In our local computing environment we have  linux, os X and windows hosts, and they mount the same shared volumes where we all store stata datasets, stata programs, and stata graphic and log file output. As usual it is the windows clients that have problems "playing well with others".  The issue is when jobs are run on linux or os X hosts, the text log files use the unix line-end conventions which is just an ASCII line feed as opposed to an ASCII carriage return-line feed pair which is what windows expects. People opening these files from windows machines using standard windows text editor programs see everything on one line. Conversely people working on the Linux and Os X hosts typically use editing tools that have no trouble recognizing the windows line-end convention for what it is and handling it gracefully, so they c!
>  read log files generated by stata on windows without difficulties.
> This suggests that the easiest solution to this problem is to direct stata on Linux and stata on os X to use the windows, rather than the unix, text file line-end characters when generating text log file output. But I have not discovered any way to do that. There is a c(eolchar) which seems to only have meaning on the os X platform, which can direct stata to use either the unix line-end convention or the older mac file line end convention. But nothing equivalent on any platform to tell stata to use CR-LF to end text lines.
> Got any ideas? I am sure others have encountered this problem before. One could of course write some script to change the log files after the fact, e.g. using emacs lisp, but that is an extra step and something that has to be remembered as opposed to something that happens automatically. Maybe there is a windows text editor less stupid than wordpad which could be installed on all the windows machines? (nothing as hard to learn as the windows emacs port, though)

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index