Source language: Translate to:

FileRead

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

FileRead

Postby rishi » Sat Jul 28, 2007 6:10 am

You would be interesting for future versions than the action "FileRead" have the option to be able to define the start and the ending, that is, for example that you read the contents between the line 20 to 40 and store it in a variable.

I hope that they take my suggestion into account.

From now on, thank you very much.

Gustavo
rishi
 
Posts: 71
Joined: Wed Oct 05, 2005 1:23 pm

Postby Neosoft Support » Mon Jul 30, 2007 5:20 pm

You can do this now using a loop action. NeoBook 5 buffers the file so the loop should be fairly fast. For example:

Code: Select all
SetVar "[Data]" ""
Loop "20" "40" "[Line]"
  FileRead "[PubDir]Filename.txt" "[Line]" "[Temp]"
  SetVar "[Data]" "[Data] [Temp]"
EndLoop
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Gaev » Mon Jul 30, 2007 5:37 pm

Dave:

I thought of this type of code ... with some additional code to check if requested line numbers did exist ... and put it all in a NeoBook Function that might be invoked like so ...
Code: Select all
Call "gkFileRead" "fileName" "startLine" "endLine" "variable"

... wondering if ... even with the afore mentioned caching (buffering) ... a Delphi code loop migh not be faster ... noticeably for large number of lines ?

Another thought that came to mind was that if there was an enhanced version of the SearchStr command ... which allowed the developer to ask for the location of the Nth iteration of the specified search string ... then one could read the entire file into a variable ... get the relative positions of the (X-1)th and Yth "newline strings" ... and do a SubStr on the difference ... fewer NeoBook Action Commands ... and other uses to boot.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby rishi » Tue Jul 31, 2007 5:30 am

Thank you very much.

This forum has really been characterized for all his members' kindness.

Greetings.

Gustavo
rishi
 
Posts: 71
Joined: Wed Oct 05, 2005 1:23 pm

Postby TechMedia » Tue Jul 31, 2007 6:59 am

There´s a plugin FREEWARE for it, with fast operation

http://www.techmediasoftware.com/freewareneo.php
TechMedia
 

Postby Neosoft Support » Tue Jul 31, 2007 10:03 am

Another thought that came to mind was that if there was an enhanced version of the SearchStr command ...


That's an interesting idea. I'll add it to the list.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest