Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

Reader.readChars(options)

{Reader}.readChars({number: {number*}})

N/file Module
Reader.readChars()
Method Description: Returns the next options.number characters from the current position. Returns less than the number if there is not enough characters to read in the file. Returns null if reading is already finished.
Returns: string
Supported Script Types: Server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/file Module
Since: 2019.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Reader.readChars(options)

Example:

// Code Example 1
// Add additional code
//...
var reader = context.input.file.getReader();

var textUntilFirstComma = reader.readUntil(',');
var next10Characters = reader.readChars(10);
var textUntilNextNewLine = reader.readUntil('\n');
var next100Characters = reader.readChars(100);

//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1543844484.html