none
Oskariok Data extension FilePlus RRS feed

  • Question

  • I have a text file (Item List.txt) with six lines of text, I wanted to use the FilePlus.GetNumberOfLines to return the number of lines in my text file. It returns  1 not 6 when run, see code below. The File.ReadContents does show 6 lines of text, am I not using the command correctly?

    path = Program.Directory

    xx=FilePlus.GetNumberOfLines (path + "\Item List.txt")
       ItemList = File.ReadContents  (path + "\Item List.txt")
       TextWindow.Write (xx)
       TextWindow.Write (ItemList )

    Thanks for any replies,

    Steve

    Monday, February 28, 2011 11:31 PM

Answers

  • Your code is OK. I used wrong text encoding in FilePlus.GetNumberOfLines so it returns wrong number. I have fixed that to my code, but you must wait for the next release.

    Sorry My Bad English
    • Proposed as answer by SFC123 Thursday, March 3, 2011 1:53 AM
    • Marked as answer by litdevModerator Tuesday, March 8, 2011 7:33 PM
    Wednesday, March 2, 2011 12:56 PM

All replies

  • Yes, there is a known bug with FilePlus.GetNumberOfLines. So I guess all you can do is to wait for the next release.
    ~~AirWaves!!~~
    • Proposed as answer by Oskariok Wednesday, March 2, 2011 12:53 PM
    Tuesday, March 1, 2011 2:41 AM
  • Your code is OK. I used wrong text encoding in FilePlus.GetNumberOfLines so it returns wrong number. I have fixed that to my code, but you must wait for the next release.

    Sorry My Bad English
    • Proposed as answer by SFC123 Thursday, March 3, 2011 1:53 AM
    • Marked as answer by litdevModerator Tuesday, March 8, 2011 7:33 PM
    Wednesday, March 2, 2011 12:56 PM
  • Thank you Oskariok, I look foward to the next release.
    Thursday, March 3, 2011 1:52 AM
  • Thank you for the reply AirWaves
    Thursday, March 3, 2011 1:52 AM