Google Docs and line endings

Discussion in 'all things UNIX' started by vasa1, Mar 31, 2012.

Thread Status:
Not open for further replies.
  1. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    I was trying to save a few files in Google Docs. No problems with two of them, but a third just refused to save. After doing a bit of reading, I'm suspecting the "line ending" may have something to do with it.
    Using "file", I see
    Code:
    MyLinks.html: HTML document text
    user.action: ASCII text
    SimpleBlock.ini: ASCII text, with CRLF, LF line terminators
    I opened each of the files in Geany, copied the contents and pasted into blank Google documents. The first two saved without problems. The third just wouldn't save (using Firefox or Chrome). It gave trouble even if I copied from gedit. Then, I opened it in LibreOffice: copying and pasting from there gave no problem.

    I'm going to look at this some more tomorrow. Weird.
     
  2. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    Okay, when I open the troublesome file in LibO, I get an ASCI filter option panel. I choose "Character set Unicode (UTF - 8 )" and then there are three choices for "paragraph break": CR & LF, CR, and LF (which is the default). Only LF works. The other two cause Goog to gag.
     
  3. Hungry Man

    Hungry Man Registered Member

    Joined:
    May 11, 2011
    Posts:
    9,148
    I only ever use google docs for very simple things and most of my documents are created on there so I have definitely not had this problem.
     
  4. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    The three files are simple text files. I've had a couple of issues elsewhere with line endings ... maybe a result of legacy files from my MS Windows (UTF-16) days.
     
  5. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,698
    Just the way windows/linux delimit lines.
    You can use a dos2unix-like converter to delimit to unix/linux format.
    For example, notepad++ can do that for you.
    Mrk
     
  6. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    Thanks, Mrk!
    I think I got it sorted in Geany. I had to go into Preferences and there I specified that line endings should be plain LF (Unix), and that there should be consistent line endings.

    I have dos2unix but never got round to figuring it out. And I know you like notepad++ the best :D
     
  7. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    Spreadsheets in Google Docs can be made more useful with the use of scripts from a "Gallery". The warning that accompanies a script at the time of installing it is even more scary than the ones seen in the Chrome Web Store. My first impression is that a script is available only for a particular spreadsheet and not "globally" which maybe a good thing. It's easy to inspect the code after installing it and then decide on keeping it or not. Of course, inspection requires knowledge of programming :( which is something I would love to have but don't.
     
  8. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    Made some "progress". I installed my first script for spreadsheets. It's called CustomFormatCreator. I like my dates to look like dd mmm yyyy, 03 Apr 2012, for example, so that there's no confusion between dd/mm/yyyy and mm/dd/yyyy.
     
  9. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    Apparently, knowledge is out there but documentation isn't easy to come by. For example, LibreOffice allows me to autofill a variety of things but the basic autofill ability of Google Spreadsheets seems very limited. But there's a function called "ArrayFormula" and it works like this:
    Code:
    =ArrayFormula("abcd"&text(row(YY1:YY25),"000"))
    will fill 25 cells down with abcd001 to abcd0025. I feel better having such a column in all my spreadsheets: it helps restore the original order of things after a wild night of sorting and, if I have stuff in one spreadsheet from several others, the "abcd" can be used to indicate the originating spreadsheet in each row.
     
Loading...
Thread Status:
Not open for further replies.