tencent cloud

Item Overview
Last updated: 2025-03-11 19:41:14
Item Overview
Last updated: 2025-03-11 19:41:14
Item represents a row of data in the parameter file and a marker indicating whether it has been deleted in the current script execution. It is used in the dataset.forEach method.

Field

Field
Type
Description
data
Record<string, string>
The column names and corresponding data values for that particular parameter row.

Methodology

Methodology
Return Type
Description
delete()
void
Mark that row of data as deleted, indicating that it will not be used during the current script execution.

Usage Examples

Traverse the parameter file, and perform modifications and deletions:
import dataset from 'pts/dataset';

export function setup() {
// Traverse the parameter file named 'test.csv'.
dataset.forEach('test.csv', (item) => {
// Change the data value of the key 'key5' in the data row item to '555'.
item.data.key5 = '555';
// If the data value of the key 'key1' in the data row item is '1', mark it as deleted, and it will not be used during the execution of this script.
if (item.data.key1 === '1') {
item.delete();
}
});
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback