Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
parse-as-csv :body ',' false
filter-rows-on regex-match body_1 ^school_id$
drop body
set columns school_id, student_id, last_name, first_name, body_5
set-column :last_name exp:{ this.width() == 5 ? (last_name + ',' + first_name) : last_name}
set-column :first_name exp:{ this.width() == 5 ? body_5 : first_name}
drop body_5

  • Line 1 parses the record as CSV with no headers.

  • Line 2 filters the header from the data rows.

  • Line 3 drops the body column since we don’t store the original data.

  • Line 5 If the number of columns is 5, then it merges salute (in wrong place first name) and last name into a single column last name.

  • Line 6 copies the data value from body_5 into first_name when column width is 5.

...