Skip to content

YAGIRO practice

Read reordered JSON fields by name

A cue sheet puts the station first in one record and the cue first in the next. Verify both assignments, then try a change that alters the field set.

Trace the two assignments

Open stations.array.json and write down the station for C07. The first object pairs C07 with pit. In the next object, the cue appears before the station, and C08 belongs to fly.

Notice that the second record still contains a field named station. Reading the first displayed value in each object would give you a station on one row and a cue on the other.

Check the conversion

Convert the array to JSON Lines. Look up station on line 1 and again on line 2. The values should be pit, then fly. Use stations.jsonl as the worked result.

Save your complete JSON Lines result before switching directions. Convert the saved lines back to an array. Compare its first element with the first source record, then the second with the second. Within each record, match cue and station by name.

Try a field that really changed

Open renamed-station.jsonl. Both lines have two members, but line 2 calls the station field stop. In lines-to-array mode the converter refuses that line because its field names differ.

The word fly remains in the same record as C08. That observation alone cannot tell you whether the writer intended stop to mean station. Check the source definition before renaming it.

Check the right kind of order

A JSON array has an element sequence. An object associates member names with values. Do not make a worksheet depend on the visual order in which different readers display an object's members.

If a destination requires a column at a specific position, agree on an explicit list of columns. For this cue sheet, keep the ordered sequence of records and the two named assignments as separate checks.

Files for this exercise

Fictional JSON and JSON Lines practice data. Use the file labeled as input in the tool. The answer files describe accepted results or expected refusals; compare them with your result.

Reference sources

Continue with a check