Code Monkey home page Code Monkey logo

Comments (5)

zubri avatar zubri commented on July 17, 2024

Have you checked this?

https://www.javadoc.io/static/com.prowidesoftware/pw-swift-core/SRU2019-8.0.2/com/prowidesoftware/swift/model/field/Field50F.html#detailsByNumber-int-

You provide the line number and you get all narratives for it.

You also have the API in the Multiline interface to get the lines including the number indicator:

https://www.javadoc.io/static/com.prowidesoftware/pw-swift-core/SRU2019-8.0.2/com/prowidesoftware/swift/model/field/MultiLineField.html

from prowide-core.

06arnab avatar 06arnab commented on July 17, 2024

Thanks for your comments. I was referring to below new structure :
50F:/123456..
1/ABC11
2/ABC21
2/ABC22
2/ABC23
2/ABC24
2/ABC25
2/ABC26
2/ABC27
2/ABC28

When we try to extract , it looks like only 3 lines for '2/' is returned ; all of the 8 lines for '2/' is not being returned. Is there anyway to extract all the contents for '2/' as above.
Please guide us.

Thanks
Arnab

from prowide-core.

zubri avatar zubri commented on July 17, 2024

The parser will drop invalid additional lines. If you need to read them all you have to use the underlying Tag structure (you can get that from SwiftBlock4 object) and parse it your self with something like:

`
Tag t = new Tag("50F", "/123456\n"+
"1/ABC11\n"+
"2/ABC21\n"+
"2/ABC22\n"+
"2/ABC23\n"+
"2/ABC24\n"+
"2/ABC25\n"+
"2/ABC26\n"+
"2/ABC27\n"+
"2/ABC28");

	SwiftParseUtils.getLines(t.getValue()).forEach(line -> {
		System.out.println(SwiftParseUtils.getTokenFirst(line, "/"));
		System.out.println(SwiftParseUtils.getTokenSecondLast(line, "/"));
	});

`

from prowide-core.

06arnab avatar 06arnab commented on July 17, 2024

Thanks again!
Do you think these are invalid additional lines? Would like to know your views as well. We were trying to readup on the recent changes , and looks like there new structures are now allowed. Any plan at your end to support such enhancements.

Thanks.

from prowide-core.

zubri avatar zubri commented on July 17, 2024

Yes, the field can have 5 lines at most. Regardless of the line identifiers and values.

In SRU2020 the validation for allowed and expected line types is changing slightly, however the overall field structure prevails.

The first line of field :50F is optional, when present must be formatted as </34x> | <4!a//27x>
The lines 2 to 5 are formatted as 1!n/33x with several constraint on the type of lines

The Prowide CORE parser is not affected by SRU2020. Just the validation on top of the same Field50F parser/model.

We already support all current and future (SRU2020) validation constraints in our https://www.prowidesoftware.com/products/integrator/validation

from prowide-core.

Related Issues (20)

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.