Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    6

    How do i get last line in text?

    Code:
    beginning_line = 4;
    end_line = 10;
    
    -- populate a table with the contents of a text file
    tabText = TextFile.ReadToTable("c:\\test.txt");
    
    -- Initialize variable strLinesOfText
    strLinesOfText = "";
    
    -- Set the current line number
    line = beginning_line;
    
    -- Loop through table until end condition is reached
    while line < (end_line + 1) do
       -- Append data to variable strLengthOfText
        strLinesOfText = strLinesOfText .. "\r\n" .. "Line " .. line .. ": " .. tabText[line] .. "\r\n";
        line = line + 1;
    end
    i want set end_line automatically
    how do i get last line in txt file?

  2. #2
    Join Date
    Apr 2005
    Location
    In Wonderworld
    Posts
    246
    Look up String reverse Find in help!

  3. #3
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Hi. I haven't tested the code yet, but it should work perfectly
    Code:
    -- Get Last Line
    tabText = TextFile.ReadToTable("c:\\test.txt");
    tblC = Table.Count(tabText);
    Last_Line = tabText[tblC]

  4. #4
    Join Date
    May 2006
    Posts
    6
    Quote Originally Posted by Mina
    Hi. I haven't tested the code yet, but it should work perfectly
    Code:
    -- Get Last Line
    tabText = TextFile.ReadToTable("c:\\test.txt");
    tblC = Table.Count(tabText);
    Last_Line = tabText[tblC]
    thanks!!!

Similar Threads

  1. Get a line out of a text file
    By StealthShadow in forum Setup Factory 7.0
    Replies: 3
    Last Post: 10-28-2005, 04:56 PM
  2. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  3. How would I find a blank line of text via "Find Text Line"?
    By Marker0077 in forum Setup Factory 6.0
    Replies: 11
    Last Post: 07-11-2003, 08:55 AM
  4. Action: Text File - Find Line
    By pjborg in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 06-07-2003, 05:10 AM
  5. "Delete Text Line" also adds a blank line at EOF
    By alian007 in forum Setup Factory 6.0
    Replies: 1
    Last Post: 07-30-2002, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts