Giter VIP home page Giter VIP logo

jsisie's Introduction

jsisie

A .NET parser for SIE files that can read files of version 1 to 4 (including 4i)

Follow this link for swedish versions and this link for english versions of the SIE specifications.

Read a SIE file

To read a file create an instance of SieDocument and call ReadDocument.

There are some properties on SieDocument that changes how the parsing works:

  • IgnoreMissingOMFATTNING: If true the parser will not flag a missing #OMFATTN as an error.
  • IgnoreBTRANS: If true #BTRANS (removed voucher rows) will be ignored.
  • IgnoreRTRANS: If true #RTRANS (added voucher rows) will be ignored.
  • IgnoreMissingDate: If true some errors for missing dates will be ignored.
  • StreamValues: If true don't store values internally. The user has to use the Callback class to get the values. Usefull for large files.
  • ThrowErrors: If false then cache all Exceptions in SieDocument.ValidationExceptions
  • DateFormat: The standard says yyyyMMdd and parser will default to that, but you can change the format to whatever you want.
  • Encoding: The standard says codepage 437, but that is not supported by dotnet core. You can change it to whatever you want. It will default to codepage 437 when running in Dotnet Framework and 28591 (ISO-8859-1) when running dotnet core. Please note that #KSUMMA will not be caclutated if you choose a multibyte encoding.

Not all features are implemented yet:

  • #UNDERDIM: There are no instances of this in the published example files.

Write a SIE file

To write a file create an instance of SieDocumentWriter and call WriteDocument The WriteOptions class contains properties to set DateFormat and Encoding.

Compare SIE files

To compare SIE files call the static method Compare on SieDocumentComparer. It will return a List<string> with differences between the files.

Even if you use this parser you should get familiar with the file specification. I have not made any extensive efforts to validate the resulting data against the files so please do your validation and tell me if you find any errors.

To install this package via nuget write

Install-Package jsisie

in the nuget console in Visual Studio

Java

There's a Java version of this parser here: https://github.com/perNyfelt/SIEParser

Change log

  • 2021-07-10 Add all test files I got from the SIE organisation. And make the test program use them.
  • 2021-07-10 Fix bug that wrote #TRANS instead of #BTRANS and #RTRANS
  • 2021-07-10 Add DateFormat, Encoding and IgnoreMIssingDate. Use ISO-8859-1 on dotnet core.
  • 2020-07-05 Now supports writing KSUMMA
  • 2017-12-22 Add #PROGRAM to the document comparer. Enable the test program to compare two files via command line.

jsisie's People

Contributors

idstam avatar

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.