GithubHelp home page GithubHelp logo

joutvhu / fixed-width-parser Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 3.0 292 KB

Fixed Width Parser: parse fixed width string to object and export object to fixed width string

License: MIT License

Java 100.00%
annotation annotations fixed-width-text java parser string-parser

fixed-width-parser's Introduction

Hi there ๐Ÿ‘‹, I'm Giao

I'm a full-stack software engineer and open-source developer from Vietnam.

Open Source Projects

Spring Dynamic Data
GitHub Actions
IDE Plugins
  • dart-scripts: Dart Scripts Runner is an IntelliJ plugin to run scripts on pubspec.yaml for Dart projects

    Git Stars Git Forks Android Studio IntelliJ IDEA Downloads Java Dart Flutter

Java Libraries
  • fixed-width-parser: Fixed Width Parser: parse fixed width string to object and export object to fixed width string

    Git Stars Git Forks Java

  • expansy: An expression analyzer that allows you to define expression elements of your design.

    Git Stars Git Forks Java

  • xirr: To calculate the internal rate of return for a schedule of cash flows that is not necessarily periodic.

    Git Stars Git Forks Java

  • date-parser: Utility to parse String to Date according to a target class, and the pattern strings. And format Date to String based on a pattern string.

    Git Stars Git Forks Java

  • model-tester: Model Tester is a utility for automatically testing model classes.

    Git Stars Git Forks Java Junit

Dart Libraries
  • number_text_input_formatter: Number Text Input Formatter for Flutter

    Git Stars Git Forks Dart Flutter

  • open_file_plus: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)

    Git Stars Git Forks Dart Flutter Android iOS

  • dioxide: Dioxide is a type conversion dio client generator.

    Git Stars Git Forks Dart

  • heif_converter: Flutter plugin to convert HEIC/HEIF file to PNG/JPEG image.

    Git Stars Git Forks Dart Flutter Android iOS

JS / TS Libraries
  • libheif-web: An emscripten build of libheif distributed as an npm module for the browser.

    Git Stars Git Forks TypeScript JavaScript NPM

  • libjs-loader: Provides a method for lazy loading of JS libraries in the browser.

    Git Stars Git Forks TypeScript JavaScript NPM

  • control-terminal: Control terminal cursor, screen and create string styling

    Git Stars Git Forks TypeScript JavaScript NPM

Other Libraries
  • form-json: Support for files upload with JSON data for Rest API

    Git Stars Git Forks .Net Spring NodeJS C# Java TypeScript Dart

Support

PayPal Buy me a coffee

fixed-width-parser's People

Contributors

f4lco avatar joutvhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fixed-width-parser's Issues

Locale on @FixedFormat

Could be useful set the locale during parsing, so the code might be as follow:

FixedParser
.parser()
.setLocale("fr_FR")
.export(myObj);

TIA

Add API for checking for model consistency?

I'd consider adding an API for extensive consistency checks in the model definitions. The annotations like @FixedField or @FixedFormat leave room for errors and inconsistencies. For example:

  1. All @FixedField annotations together do not describe the dataset exhaustively, meaning there are gaps in the data which do not map onto a @FixedField.
  2. The length of a format pattern exceeds the length allocated by @FixedField.
  3. The length of the @FixedField is too small to accommodate the nested @FixedObject.
  4. ...

I have already prototyped the first rule - all fields must be 'contiguous' / 'gapless' - and found it to be very useful, because the check already identified a typo in one of my model objects.

Mind that this is not only about detectable error conditions, but also about heuristics. As a result, one could have different severity levels like 'error', or 'warning'.

What do you think? Does such a feature fit the scope of your project?

Parsing fixed width string with variable segments

I have a variable segments structure like,

A001{field1-2character}{field2-12characters}{field3-21characters}C001{field4-1character}{field5-10characters}{field6-13characters}D001{field7-12character}{field8-2characters}{field9-21characters}

another string can be

A001{field1-2character}{field2-12characters}{field3-21characters}B001{field11-5characters}{field12-8characters}{field13-3characters}D001{field7-12character}{field8-2characters}{field9-21characters}E001{field20-5characters}{field21-12characters}{field22-2characters}

As mentioned we have segments like A001, B001 , C001, D001, etc.. All segments have fixed format fields. However some segments may or may not be present in a given string. The parser needs to figure out whether a segment is there or not and execute parser logic specific to the segment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.