realbasic-nug
[Top] [All Lists]

Re: SYLK Error

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: SYLK Error
From: Corey Redlien <corey at redlien dot com>
Date: Thu, 31 Mar 2005 23:30:14 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050330033351 dot E25168072B8 at lists dot realsoftware dot com> <524a8a3caf24f147721b23ad07b5cb01 at earthlink dot net>
This is basically the entire code I've got going on... the thing is, I use this style code in a few other places, and it works fine...

f = GetFolderItem( TemporaryFolder.Child(d.ShortDate + " " + type+ ".txt").AbsolutePath )
  if f <> nil then
    f.MacType = "TEXT"
    f.MacCreator = "XCEL"
    textOut = f.CreateTextFile

      textOut.writeTabbedEncoded "ID"
      for i=2 to oppListbox.ColumnCount - 1
        textOut.writeTabbedEncoded oppListbox.Heading(i)
      next
      textOut.WriteLine
      for i=0 to oppListbox.ListCount - 1
        textOut.writeTabbedEncoded str(i)
        for j=2 to oppListbox.ColumnCount - 1
          text = ReplaceAll( oppListbox.Cell(i,j), chr(9), " " )
          textOut.writeTabbedEncoded text
        next
        textOut.WriteLine
      next
    textOut.Close

  end if
Return f

writeTabbedEncoded is an extend of the textOutputstream:

  w.Write ConvertEncoding( tText, Encodings.MacRoman ) + chr(9)


Thanks!


On Mar 31, 2005, at 11:01 PM, David Firth wrote:

Anyone know how this error is caused?

SYLK: file format is not valid

This is generated when I create, and save a .tsv (tab separated
values) text file and try to launch it (or manually open it) in
Microsoft Excel... I can open it up as text in every other text app
without any issues, though.

SYLK is an old data interchange format. My old 1985 vintage Tandy 200 had SYLK built into its Multiplan spreadsheet. SYLK files were text readable. I've not seen a SYLK file in a long time. I knew SYLK was kept in Excel as an import option for a long time and was extended beyond what I knew back in the 80s, but I was unaware that Excel could still read the things.

If Excel is interpreting the file as SYLK then there's something about the file name or the data it is seeing that is triggering it to try and load it as SYLK. You mention tab separated, but that shouldn't matter. If I remember correctly SYLK was a command or definition on each line. I cannot remember offhand the identifying character(s) for the beginning of each command, though.

What about posting a line or two of your file? It may trigger a remembrance of what a SYLK command looks like.


--
David Firth
djfirth at mindspring dot com
djfirth at earthlink dot net
davidfirth1 at mac dot com

"social change can occur when have-nots, advocating change, are assisted by well placed haves who will help to pry open doors too long closed to justice and care" -- Bishop Joe Sprague, UMC

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>