-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader doesn't return full multi-line texts #126
Comments
What's your use case for Reader? What you would like to achieve? |
Well, I want to extract that line of text. What are you implying by your question? I've just found https://www.truugo.com/edifact/d96a/imd/ which seems to indicate that the D96.A schema actually defines two lines. If that's true, which would mean that splitting lines isn't actually a feature, then I could at least handle it by first retrieving the 1st part and then just appending the 2nd part, if not empty. |
Not implying anything, I wanted to understand your use case and see if we can add a simpler way :) in my use cases usually I use the Interpreter class and I extract the information while looping the segments, are you looking to extract only that line? |
The text is actually hundreds of characters long, and the split occurs after 255 characters… I actually hadn't even considered the Interpreter TBH. I think I initially dismissed it because I thought it would need more RAM to do it's thing, it being XML based. Thanks, I shall try and see how it does. But I think I'll just do as I said, now that I've thought about it, and just concatenate the two sub-segments. Since this doesn't actually seem to be an EDIFACT feature, I'll close this ticket. |
EDI text may span multiple lines by breaking it apart using the
:
character.In the
Reader::readEdiDataValue()
method, a field like that will be spread across multiple array entries, because the EDI value is blindly split at every:
.Since you can't really know how many lines of text there will be beforehand, you can't really retrieve the full text via that method, only ever the 1st part up to the 1st line-break introduced by the
:
.Example from a PRICAT file:
$reader->readEdiDataValue(['IMD', ['1' => 'F', '2' =>'DS2']], 3, 3)
will only return the textThe first line goes here
.Interestingly, the
Analyzer
does mark both array entries as description and the last one as language code.The text was updated successfully, but these errors were encountered: