Skip to content

Latest commit

 

History

History
31 lines (30 loc) · 637 Bytes

README.MD

File metadata and controls

31 lines (30 loc) · 637 Bytes

regular expression util scripts

json_one_line_converter.pl

Perl script for converting human readable json structure to single line json string for curl requests body.

example:

Convert source file source.json to result.txt

{
  "name": "docs",
  "array":
    [
      "first",
      "second",
      "third"
    ],
  "additional":
  {
    "date": "18.02.20",
    "number": 473
  }
}

just run:

perl json_one_line_converter.pl source.json > result.txt

output in result.txt:

{\"name\":\"docs\",\"array\":[\"first\",\"second\",\"third\"],\"additional\":{\"date\":\"18.02.20\",\"number\":473}}