Skip to content

YAGIRO practice

Keep the spelling on a drawer tag

Find leading zeroes, a long identifier, a printed decimal and the word null in two JSON objects. Check what another program would need to preserve.

Predict the first tag

A fictional workshop prints 0008 on a drawer. Its scale mark reads 3.00 and its FlagText cell contains the four letters true. Open drawer-tags.tsv as text. The tab after true leaves a fourth field whose contents are empty.

Inspect the JSON values

Paste the text, choose tab and Row objects, and convert. Find the first object in expected.json. The quotes surrounding "0008" and "3.00" are JSON syntax. Inside those quotes the leading and trailing zeroes match the print. The flag is "true", and Margin is the empty string "".

The second Tag is "9007199254740993". Copy its digits from the JSON and count them against the source. The second ScaleMark keeps its minus sign and both zeroes after the decimal point. Its FlagText is "null", a four-letter string.

Check the spaces that survive

Find the word keep in the second Margin. The value includes two ordinary spaces on each side. Spaces outside the quoted strings in the JSON can change when a reader formats the document. The spaces inside Margin belong to the recorded text.

Decide how the next reader should treat each field

An inventory lookup can use the drawer tag as a string key. A calculation using the scale mark needs a separate decision about its unit and rounding. If a receiving system converts values during import, inspect the stored result for both tags and the empty Margin before using a larger file.

Files for this exercise

Fictional practice data. CSV and TSV files are the inputs. Compare your result with expected.json, which contains the expected JSON output and is not a tool input.

Reference sources

Continue with a check