Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

Reader.readUntil(options)

{Reader}.readUntil({tag: {string*}})

N/file Module
Reader.readUntil()
Method Description: Returns string from current position to the next occurrence of options.tag. Returns the rest of the string if tag is not found. Returns null if reading is already finished. All types of characters are supported. If there's a character that does not exist untl the end of the file, the rest of the file is returned.
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.readUntil(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_1543844425.html