---------- Forwarded message ---------- From: John C Frain <fra...@gmail.com> Date: 14 October 2010 18:20 Subject: Re: [R] [OT] (slightly) - OpenOffice Calc and text files To: "Schwab,Wilhelm K" <bsch...@anest.ufl.edu>
Just a basic comment on Open Office Calc. I find Open Office Calc and excellent program for viewing and minor processing of data - much better than Excel. In particular it is a very flexible tool for transferring data between different packages. However one must take a certain amount of care in its use. If you import a csv or text file into open office it is reformatted by Calc. If you save this as csv or text or similar then the default is to save exactly as displayed. If I wish to retain more significant data or dates in a particular format use the various format facilities in Calc to ensure that what you require is displayed in Calc before you save as csv or similar. There is also a useful facility to edit the output facilities before saving. Calc or Excel or Write or Word do add formatting that any plain text editor (Scite Notepad++ Emacs etc.) do not. Best Regards John On 13 October 2010 21:27, Schwab,Wilhelm K <bsch...@anest.ufl.edu> wrote: > I know *what* happened (Calc reformatted the data in ways I did not want or > expect). It is not end-of-line conventions; they reformatted the data > leaving the structure intact. As to why/how, that could depend on the > sequence of operations, so I thought to ask here to see if you had > collectively either found something specific to do or to avoid. > > Gnumeric is now freshly installed and will get some testing; if I don't care > for it, I'll look more at emacs. I don't ask much of a spreadsheet > (show/edit a grid and maybe hide/show columns for complex data sets), but it > would be nice if it did not reformat everything every time I open a file :( > > So far, gnumeric successfully opened a file; I will be a little less trusting > when it comes to saving one. Thanks!! > > Bill > > > > > ________________________________________ > From: Mike Marchywka [marchy...@hotmail.com] > Sent: Wednesday, October 13, 2010 3:10 PM > To: dwinsem...@comcast.net; Schwab,Wilhelm K > Cc: r-help@r-project.org > Subject: RE: [R] [OT] (slightly) - OpenOffice Calc and text files > > ---------------------------------------- >> From: dwinsem...@comcast.net >> To: bsch...@anest.ufl.edu >> Date: Wed, 13 Oct 2010 14:52:21 -0400 >> CC: r-help@r-project.org >> Subject: Re: [R] [OT] (slightly) - OpenOffice Calc and text files >> >> >> On Oct 13, 2010, at 1:13 PM, Schwab,Wilhelm K wrote: >> >> > Hello all, >> > >> > I had a very strange looking problem that turned out to be due to >> > unexpected (by me at least) format changes to one of my data files. >> > We have a small lab study in which each run is represented by a row >> > in a tab-delimited file; each row identifies a repetition of the >> > experiment and associates it with some subjective measurements and >> > times from our notes that get used to index another file with lots >> > of automatically collected data. In short, nothing shocking. >> > >> > In a moment of weakness, I opened the file using (I think it's >> > version 3.2) of OpenOffice Calc to edit something that I had mangled >> > when I first entered it, saved it (apparently the mistake), and >> > reran my analysis code. The results were goofy, and the problem was >> > in my code that runs before R ever sees the data. That code was >> > confused by things that I would like to ensure don't happen again, >> > and I suspect that some of you might have thoughts on it. >> > >> > The problems specifically: >> > >> > (1) OO seems to be a little stingy about producing tab-delimited >> > text; there is stuff online about using the csv and editing the >> > filter and folks (presumably like us) saying that it deserves to be >> > a separate option. >> >> You have been little stingy yourself about describing what you did. I >> see no specifics about the actual data used as input nor the specific >> operations. I just opened an OO.o Calc workbook and dropped a >> character vector, "1969-12-31 23:59:50" copied from help(POSIXct) into > > > >> > Have any of you found a nice (or at least predictable) way to use OO >> > Calc to edit files like this? >> >> I didn't do anything I thought was out of the ordinary and so cannot >> reproduce your problem. (This was on a Mac, but OO.o is probably going >> to behave the same across *NIX cultures.) >> >> -- >> David >> >> > If it insists on thinking for me, I wish it would think in 24 hour >> > time and 4 digit years :) >> >> Is it possible that you have not done enough thinking for _it_? >> >> > I work on Linux, so Excel is off the table, but another spreadsheet >> > or text editor would be a viable option, as would configuration >> > changes to Calc. >> > >> > Bill > > Probably instead of guessing and seeing how various things react, you > could go get a utility like octal dump or open in an editor that > has a hex mode and see what happened. This could be anything- crlf convention, > someone turned it to unicode, etc. On linux or cygwin I think you have > "od" available. Then of course, if you know what R likes, you can use > sed to fix it... > > ______________________________________________ > R-help@r-project.org mailing list > 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. > -- John C Frain Economics Department Trinity College Dublin Dublin 2 Ireland www.tcd.ie/Economics/staff/frainj/home.html mailto:fra...@tcd.ie mailto:fra...@gmail.com -- John C Frain Economics Department Trinity College Dublin Dublin 2 Ireland www.tcd.ie/Economics/staff/frainj/home.html mailto:fra...@tcd.ie mailto:fra...@gmail.com ______________________________________________ R-help@r-project.org mailing list 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.