complete.tools

Format Text as Form

Turn lines of text like 'Name: Ada' or 'Colour - blue' into a tidy list of labels and values, with a JSON copy.

What this tool does

Turn lines of text like 'Name: Ada' or 'Colour - blue' into a tidy list of labels and values, with a JSON copy. You fill in these fields: Text, one entry per line. It shows fields found, JSON, lines read, and lines skipped (no value), plus a table (form fields).

Inputs

  • Text, one entry per line: Longer text, up to 100000 characters. Use 'Label: value' or 'Label - value'. Lines with neither are kept as a Note.

How to use

  1. Type the text, one entry per line.
  2. Read the result: fields found, JSON, lines read, and lines skipped (no value), plus a table (form fields). It appears once every required field has a valid value.
  3. Use the copy button to copy the text.

Worked examples

Example 1. Inputs:

  • Text, one entry per line: "Name: John Doe Age: 30 Occupation: Developer"

Results:

  • Fields found: 3
  • Form fields, row 1 of 3: Label Name; Value John Doe
  • Form fields, row 2 of 3: Label Age; Value 30
  • Form fields, row 3 of 3: Label Occupation; Value Developer
  • Lines read: 3
  • Lines skipped (no value): 0

How this is worked out: Three lines, each split at the first colon followed by a space: Name/John Doe, Age/30, Occupation/Developer. 3 fields, none skipped.

Example 2. Inputs:

  • Text, one entry per line: "Time: 10:30 am well-known fact Colour - café au lait See http://a.com Empty: ..."

Results:

  • Fields found: 5
  • Form fields, row 1 of 5: Label Time; Value 10:30 am
  • Form fields, row 2 of 5: Label Note; Value well-known fact
  • Form fields, row 3 of 5: Label Colour; Value café au lait
  • Lines read: 6
  • Lines skipped (no value): 1

How this is worked out: Non-blank lines (6): 'Time: 10:30 am' splits at the first colon followed by a space, so the clock colon stays in the value. 'well-known fact' has no ': ' and no ' - ', so it is a Note. 'Colour - café au lait' splits at ' - '. 'See http://a.com' has a colon but followed by '/', so no split, a Note. The blank line is not counted. 'Empty:' has an empty value, skipped (1). ' Note : spaced ' is trimmed to label 'Note', value 'spaced'. 5 fields.

Example 3. Inputs:

  • Text, one entry per line: "Ref : A-1 Total - 3 - 4"

Results:

  • Fields found: 2
  • Form fields, row 1 of 2: Label Ref; Value A-1
  • Form fields, row 2 of 2: Label Total; Value 3 - 4
  • Lines read: 2
  • Lines skipped (no value): 0

How this is worked out: CRLF lines. 'Ref : A-1' splits at the colon: Ref / A-1 (the hyphen in A-1 has no spaces so is untouched). 'Total - 3 - 4' has no colon so it splits at the first ' - ': Total / '3 - 4'. JSON is the two objects pretty-printed with 2-space indent.

Example 4. Inputs:

  • Text, one entry per line: ": orphan Empty: A: b Meet - 10:30"

Results:

  • Fields found: 3
  • Form fields, row 1 of 3: Label Note; Value : orphan
  • Form fields, row 2 of 3: Label A; Value b
  • Form fields, row 3 of 3: Label Meet; Value 10:30
  • Lines read: 4
  • Lines skipped (no value): 1

How this is worked out: ': orphan' has a colon followed by a space but nothing before it, and no ' - ', so the whole line is kept as a Note. 'Empty:' followed by a tab trims to 'Empty:', an empty value, skipped (1). 'A:' then a tab then 'b' splits at the colon because a tab is whitespace: A / b. 'Meet - 10:30' has a colon, but '3' follows it, so the colon does not split and the spaced hyphen does: Meet / 10:30. Four non-blank lines, 3 fields.

Limitations

  • One entry per line. Values that continue on the next line are read as separate entries.
  • If a line has both a colon followed by a space and a spaced hyphen, the colon wins, wherever it sits in the line.
  • A line that starts with the colon or hyphen, so has no label, is kept whole as a Note.
  • Blank lines are ignored and are not counted in Lines read. Repeated labels are all kept, in order.
  • The result is a list and JSON copy, not a fillable form.

FAQs

Q: How does it decide where the label ends?
A: At the first colon that is followed by a space or the end of the line. If there is none, at the first ' - ' (a hyphen with a space on each side). Otherwise the whole line becomes a Note.
Q: Why was my time or web address not split?
A: A colon only splits when whitespace follows it, so '10:30' and 'http://example.com' stay whole.
Q: What happens to a line with a label but no value?
A: It is skipped and counted under 'Lines skipped'.
Q: Is my text uploaded?
A: No. The text is split by simple rules in your browser.

Explore Similar Tools

Explore more tools like this one: