Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Latest commit

 

History

History
35 lines (27 loc) · 944 Bytes

TXTReader.loopAllLines.md

File metadata and controls

35 lines (27 loc) · 944 Bytes

TXTReader.loopAllLines

The function to loop all lines for the callback function calling.

Sample

	//The content of the test.txt file is 
	//"12345678901234567890
	// 11111222223333344444
	// 99999777777777722222"
	var regFieldsDef="(.{5})(.{10})(.{5})";
	var txtReader = new TXTReader("input/test.txt", regFieldsDef, "MS932"); 
	txtReader.loopAllLines(callback);	// The function "callback" will be executed three times
function callback(aryField, index) {
	...
};

API

CallingReturning
TXTReader . loopAllLines(callback)Array
ParametersTypeDescription
callback(aryField, index)Function The function that is expected to execute line-by-line.
aryField : The array data.
index : The line number which counts from 0.