...
...
...
...
...
...
...
...
Code Block | ||
---|---|---|
| ||
param ($row)
|
This means that the script will receive each original CSV row into this script's $row variable. The rest of the script can be any valid Powershell code. The goal of the script is to inspect and possibly-modify that $row variable. Naturally there are 2 fundamental things you may need to do:
- Inspect the original value of a named column within that row.
- Alter the original value of a named column within that row.
In either case, we refer to the column by name:
...
language | powershell |
---|---|
title | Inspect and Modify Columns Within a Row |
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Here, we see that the ODS rejects this first attempt, because the excess spaces resulted in invalid studentUniqueId values. Surely the extra spaces in the score values would also become problematic after correcting the studentUniqueId values. We'll need to intervene with both of these problematic columns before we could expect the ODS to accept them.
...
...
...
...
...