{"id":19438833,"url":"https://github.com/danwild/text2json","last_synced_at":"2025-04-24T22:32:11.125Z","repository":{"id":65374711,"uuid":"58979212","full_name":"danwild/text2json","owner":"danwild","description":"Convert delimited txt file to json","archived":false,"fork":false,"pushed_at":"2017-10-15T22:16:44.000Z","size":11,"stargazers_count":22,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T18:06:32.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danwild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-17T01:10:15.000Z","updated_at":"2024-05-09T13:31:08.000Z","dependencies_parsed_at":"2023-01-20T01:25:21.955Z","dependency_job_id":null,"html_url":"https://github.com/danwild/text2json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Ftext2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Ftext2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Ftext2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Ftext2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danwild","download_url":"https://codeload.github.com/danwild/text2json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223969144,"owners_count":17233596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T15:19:56.044Z","updated_at":"2024-11-10T15:19:56.628Z","avatar_url":"https://github.com/danwild.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-2-json [![NPM version][npm-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url]\n\nSmall CLI style node app to convert delimited `.txt` files into `.json`\n\n## install\n\nInstall with npm: `npm install text-2-json`\n\n## use\n\nRun from command line, takes four args:\n\n- `i`, the path of input txt file, e.g. \"input/path/text.txt\"\n- `o`, the path of output json file, e.g. \"output/path/result.json\"\n- `h`, optional flag indicating whether or not to use the first row of the file as object keys.\n- `p`, optional Regex pattern to match field separator, e.g: `[^\\\\t]+`. Defaults to: `[^\\\\n\\\\r\\\\t ]+`\n\nExample:\n\n`node index.js --i=test/test.txt --o=test/output.json --h`\n\nTurns:\n\n```\ntest max min direction\n10 27.7 12.4 12\n11 26.9 13.5 18\n12 27.4 16.9 31\n13 25.1 12.7 29\n```\n\nInto:\n\n```javascript\n[\n\t{\n\t\t\"test\": \"10\",\n\t\t\"max\": \"27.7\",\n\t\t\"min\": \"12.4\",\n\t\t\"direction\": \"12\"\n\t},\n\t{\n\t\t\"test\": \"11\",\n\t\t\"max\": \"26.9\",\n\t\t\"min\": \"13.5\",\n\t\t\"direction\": \"18\"\n\t},\n\t{\n\t\t\"test\": \"12\",\n\t\t\"max\": \"27.4\",\n\t\t\"min\": \"16.9\",\n\t\t\"direction\": \"31\"\n\t},\n\t{\n\t\t\"test\": \"13\",\n\t\t\"max\": \"25.1\",\n\t\t\"min\": \"12.7\",\n\t\t\"direction\": \"29\"\n\t}\n]\n```\n\n## parse multiple files\n\nOpen command line and run: `sh parseMultipleFiles.sh`\n\n[npm-image]: https://badge.fury.io/js/text-2-json.svg\n[npm-url]: https://www.npmjs.com/package/text-2-json\n[npm-downloads-image]: https://img.shields.io/npm/dt/text-2-json.svg\t  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanwild%2Ftext2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanwild%2Ftext2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanwild%2Ftext2json/lists"}