Loading text files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dulux1309
    Indigo Rose Customer
    • Feb 2003
    • 172

    Loading text files

    Hi,

    I have created a text object and also a basic .txt file in Notepad, then tried to use the 'load' option to display the file in the object. (I am assuming this is what it is for). All I get is an error that 'this is not a valid ASCII text file'???

    Has anyone else seen this?
    With our fists clenched,
    We cannot shake hands
  • dulux1309
    Indigo Rose Customer
    • Feb 2003
    • 172

    #2
    I have narrowed it down to the fact that the text file I am importing contains £ signs...should this cause the error?
    With our fists clenched,
    We cannot shake hands

    Comment

    • Julia@ININ
      Forum Member
      • Jun 2007
      • 5

      #3
      Error - not valid ASCII .txt file

      I ran into this problem too. In this instance it was because there was a 'curly' apostrophe in the .txt file. This happens when it's typed in word and then copied/pasted into a .txt file. The character doesn't convert to plain text.

      Hopes this helps someone else.

      Comment

      • longedge
        Indigo Rose Customer
        • Aug 2003
        • 2498

        #4
        If you paste from Word into Notepad and then save the file out as a .txt file it should strip out all the formatting, is my understanding anyway.

        I get no problems using this code -

        Code:
        result = TextFile.ReadToString("AutoPlay\\Docs\\test.txt");
        Label.SetText("Label1", result);
        to load and display a text file (including the £ sign) in a label.

        After 3 years it won't matter to the OP anyway will it

        Comment

        Working...
        X