{"id":16485319,"url":"https://github.com/morganconrad/unformatter","last_synced_at":"2025-02-28T22:40:59.974Z","repository":{"id":71410132,"uuid":"189294136","full_name":"MorganConrad/unformatter","owner":"MorganConrad","description":"Parses data written by a java.util.Formatter.  Not quite a scanf since the format details are different.","archived":false,"fork":false,"pushed_at":"2019-06-02T03:34:23.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T14:45:47.291Z","etag":null,"topics":["formatter","java","parser","scanf"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/MorganConrad.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-29T20:34:06.000Z","updated_at":"2019-06-15T21:41:24.000Z","dependencies_parsed_at":"2023-04-19T06:05:31.814Z","dependency_job_id":null,"html_url":"https://github.com/MorganConrad/unformatter","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/MorganConrad%2Funformatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Funformatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Funformatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Funformatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorganConrad","download_url":"https://codeload.github.com/MorganConrad/unformatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241261791,"owners_count":19936046,"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":["formatter","java","parser","scanf"],"created_at":"2024-10-11T13:25:26.053Z","updated_at":"2025-02-28T22:40:59.949Z","avatar_url":"https://github.com/MorganConrad.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/MorganConrad/unformatter.png)](http://travis-ci.org/MorganConrad/unformatter)\n\n\nunformatter\n====\n\nJava code to parse an input CharSequence, controlled by a format string from a [java.util.Formatter.](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html)\n\nSimilar in concept to a \"scanf\", but the format String syntax is different.  **This code is mainly intended to be used with fixed records.**\n\n### Usage\n\nSay you created a String with the following code\n\n    String format = \"This is my data: %5d%7x%7o%4s%4.2f values in %%\";\n    String result = String.format(format, 1234, 0x1234, 01234, \"1234\", 1234.56);\n    \n    result = \"This is my data:  1234   1234   123412341234.56 values in %\"\n\nTo read back the information:\n\n    Unformatter unf = new Unformatter(format);\n    List\u003cObject\u003e scanned = unf.unformat(result);\n\nscanned will contain the following:\n\n 0. Long 1234\n 1. Long 4660 (same as hex  0x1234)\n 2. Long 668  (same as octal 01234)\n 3. String \"1234\"\n 4. Double 1234.56\n 5. CharSequence \"\"\n\nAll parsed values are returned as Longs, Doubles, or Strings as appropriate.  \n\nThe last element (5 in the above example) represents any remaining data in the input that was not parsed.  This is useful if you are reading from a CharSequence containing multiple records.\n\n### Supported Format Conversions\n\n**Note:** Since this if for reading fixed formats, all conversions should include a width!\n\n * d decimal, returned as a Long\n * f floating point, returned as a Double\n * h hex, returned as a Long\n * o octal, returned as a Long\n * s string, returned as a String\n * % not really a conversion, but \"%%\" in the format is converted to fixed text \"%\"\n * n not really a conversion, but \"%n\" in the format is converted to a fixed text newline\n\n### Unsupported Stuff\n \n * any conversions not noted above, including uppercase\n * argument indexing\n * flags  (sorry, no locale-specific grouping for now)\n\n \n \n### API   \n  For more, consult the code or the [zipped javadocs](https://github.com/MorganConrad/unformatter/blob/master/javadocs.zip)\n\n#### Unformatter\n\n##### Unformatter(String format)                    \n * constructor, taking a format string\n  \n##### List unformat(CharSequence input)     \n * parses input, \n * returns a List contain Longs, Doubles, or Strings for the data.\n * the last element in the List is a CharSequence of any reminaing input.\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Funformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganconrad%2Funformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Funformatter/lists"}