{"id":19792160,"url":"https://github.com/making/ltsv4j","last_synced_at":"2025-05-01T02:30:23.999Z","repository":{"id":6838028,"uuid":"8086467","full_name":"making/ltsv4j","owner":"making","description":"Labeled Tab Separated Value(http://ltsv.org/) manipulator for Java","archived":false,"fork":false,"pushed_at":"2016-01-15T08:48:43.000Z","size":192,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T07:43:11.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/making.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-08T02:55:16.000Z","updated_at":"2024-12-09T19:53:18.000Z","dependencies_parsed_at":"2022-08-06T03:15:44.422Z","dependency_job_id":null,"html_url":"https://github.com/making/ltsv4j","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fltsv4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fltsv4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fltsv4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fltsv4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/making","download_url":"https://codeload.github.com/making/ltsv4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812226,"owners_count":21647866,"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-12T07:06:10.811Z","updated_at":"2025-05-01T02:30:23.767Z","avatar_url":"https://github.com/making.png","language":"Java","readme":"# LTSV4J\r\n\r\nLabeled Tab Separated Value(http://ltsv.org/) manipulator for Java\r\n\r\nThis library is inspired by https://metacpan.org/module/Text::LTSV.\r\n\r\n## Usage\r\n\r\n### simple\r\n\r\n    Map\u003cString, String\u003e line = LTSV.parser().parseLine(\"hoge:foo\\tbar:baz\\n\"); =\u003e {\"hoge\" : \"foo\", \"bar\" : \"baz\"}\r\n    String line = LTSV.formatter().formatLine(line) =\u003e \"hoge:foo\\tbar:baz\"\r\n\r\n    Map\u003cString, String\u003e line = LTSV.parser().ignores(\"hoge\").parseLine(\"hoge:foo\\tbar:baz\\n\"); =\u003e {\"bar\" : \"baz\"}\r\n    Map\u003cString, String\u003e line = LTSV.parser().wants(\"hoge\").parseLine(\"hoge:foo\\tbar:baz\\n\"); =\u003e {\"hoge\" : \"foo\"}\r\n\r\n    List\u003cMap\u003cString, String\u003e\u003e lines = LTSV.parser().parseLines(\"test.ltsv\");\r\n    LTSV.formatter.formatLines(lines, \"foo.ltsv\");\r\n\r\nstrict mode\r\n\r\nStrictly label must be `%x30-39 / %x41-5A / %x61-7A / \"_\" / \".\" / \"-\"`\r\nand field must be `%x01-08 / %x0B / %x0C / %x0E-FF`.\r\n\r\nBy default, parser does not check this rule. To enable this, use strict() method.\r\n\r\n    LTSV.parser().strict().parseLine(\"@@:foo\"); =\u003e throw LTSVParseException \r\n\r\n### iterator\r\n\r\ntest.ltsv\r\n\r\n    a:1 b:2 c:3\r\n    a:4 b:5 c:6\r\n    a:7 b:8 c:9\r\n\r\nIterator interface is available to read ltsv file\r\n\r\n    try (LTSVIterator iterator = LTSV.parser().iterator(\"test.ltsv\")) {\r\n        {\r\n            assertThat(iterator.hasNext(), is(true));\r\n            Map\u003cString, String\u003e line = iterator.next();\r\n            assertThat(line.get(\"a\"), is(\"1\"));\r\n            assertThat(line.get(\"b\"), is(\"2\"));\r\n            assertThat(line.get(\"c\"), is(\"3\"));\r\n        }\r\n        {\r\n            assertThat(iterator.hasNext(), is(true));\r\n            Map\u003cString, String\u003e line = iterator.next();\r\n            assertThat(line.get(\"a\"), is(\"4\"));\r\n            assertThat(line.get(\"b\"), is(\"5\"));\r\n            assertThat(line.get(\"c\"), is(\"6\"));\r\n        }\r\n        {\r\n            assertThat(iterator.hasNext(), is(true));\r\n            Map\u003cString, String\u003e line = iterator.next();\r\n            assertThat(line.get(\"a\"), is(\"7\"));\r\n            assertThat(line.get(\"b\"), is(\"8\"));\r\n            assertThat(line.get(\"c\"), is(\"9\"));\r\n        }\r\n        assertThat(iterator.hasNext(), is(false));\r\n    }\r\n\r\nNote that `LTSVIterator` must be closed finally. `LTSVIterator` extends `java.lang.AutoCloseable`, so you can use try-with-resources statement supported from Java7.\r\n\r\n## Use with Maven\r\n\r\nyou can get this artifact from Maven Central Repository :)\r\n\r\n    \u003cdependencies\u003e\r\n      \u003cdependency\u003e\r\n        \u003cgroupId\u003eam.ik.ltsv4j\u003c/groupId\u003e\r\n        \u003cartifactId\u003eltsv4j\u003c/artifactId\u003e\r\n        \u003cversion\u003e0.9.0\u003c/version\u003e\r\n      \u003c/dependency\u003e\r\n    \u003c/dependencies\u003e\r\n\r\n## Prerequisites\r\n\r\n* JDK7+\r\n\r\n## License\r\n\r\nLicensed under the Apache License, Version 2.0.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fltsv4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaking%2Fltsv4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fltsv4j/lists"}