-
Notifications
You must be signed in to change notification settings - Fork 138
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
Error: reached end of input before finding ISA segment identifier #12
Comments
Hi Josh, I'm assuming you have something like The second return value from this call will always be The first return value, |
Here's what I've got...
Something just feels...off. I've run through the documentation and tried various methods to access the data and just can't seem to get it. Maybe I'm doing something wrong? |
Looks like you just need to rewind the parser to the start of the parse tree -- the Take a look at bin/edi-pp for an example, but Secondly, your document is QM214, which I recently merged into the contrib namespace. You'll need to use Since these were contributed by other authors and I don't have the official grammar for this transaction, you probably need to make changes to the grammar. For instance, the grammar in Stupidedi for QM214 doesn't allow -- Kyle |
Gotcha! Okay, getting there. One more question...how do I select the second of a duplicate element? For example, there's this segment:
Then I do this: a.flatmap{|m| m.find(:GS) }.flatmap{|m| m.find(:ST) }.tap do |m|
el(m.find(:L11), 3){|e| puts "Transaction Reference Number: #{e}" }
el(m.find(:L11)){|e| puts "Tracking Number: #{e}" }
end That first (Really appreciate your help so far!) |
It seems like the second element of el(m.find(:L11, nil, "TN"), 3){|e| ... }
el(m.find(:L11, nil, "2I"), 3){|e| ... } You'll need to check specs for QM 214 to be certain, but usually that's how these documents work. If you can have many # Loop through each L11 sequentially
m.iterate(:L11) do |l11|
el(l11, 3){|el| ... }
end |
I've also added a method a.flatmap{|m| m.sequence(:GS, :ST) }.tap do |m|
...
end |
When trying to read some data, I'm getting this error:
reached end of input before finding ISA segment identifier
Here's the sample data: https://gist.github.com/Shpigford/daedb0a0e2eeb52cd384
This is data directly from the provider (in this case, UPS). And seems pretty standard across all the files I'm receiving from them.
The text was updated successfully, but these errors were encountered: