Step thru a file one line at a time

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 8
Joined: Sun Nov 13, 2011 7:02 pm
Location: Dayton, Ohio, USA

Step thru a file one line at a time

Post by Dellji »

I haven't been able to find a way to step thru a text file one line at a time.
The file is a windows file and contains 2.6 million lines
I would like to access each line separately
The lines vary in length up to 255 characters.

Is there a way to accomplish this?

Jim

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Dellji

Code: Select all

var nLine    = 0; //first line
var hWndEdit = AkelPad.GetEditWnd();
var nOffset1 = AkelPad.SendMessage(hWndEdit, 3138 /*AEM_GETRICHOFFSET*/, 41 /*AEGI_RICHOFFSETFROMUNWRAPLINE*/, nLine);
var nOffset2 = AkelPad.SendMessage(hWndEdit, 3138 /*AEM_GETRICHOFFSET*/, 19 /*AEGI_WRAPLINEEND*/, nOffset1);
var sText    = AkelPad.GetTextRange(nOffset1, nOffset2);

WScript.Echo(sText);

Offline
Posts: 8
Joined: Sun Nov 13, 2011 7:02 pm
Location: Dayton, Ohio, USA

Post by Dellji »

KDJ wrote:Dellji

Code: Select all

var nLine    = 0; //first line
var hWndEdit = AkelPad.GetEditWnd();
var nOffset1 = AkelPad.SendMessage(hWndEdit, 3138 /*AEM_GETRICHOFFSET*/, 41 /*AEGI_RICHOFFSETFROMUNWRAPLINE*/, nLine);
var nOffset2 = AkelPad.SendMessage(hWndEdit, 3138 /*AEM_GETRICHOFFSET*/, 19 /*AEGI_WRAPLINEEND*/, nOffset1);
var sText    = AkelPad.GetTextRange(nOffset1, nOffset2);

WScript.Echo(sText);
The echo box doesn't display the first record. Its blank
Post Reply