-
-
Notifications
You must be signed in to change notification settings - Fork 78
Get CSV row index #227
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
Comments
@emily-coffin No, currently there is no such a mechanism to pass some metadata (such as line number) from a csv2 reader to its transformation schema. Assuming your csv schema version is "csv2", I'm thinking about introduce a record level original schema: https://github.com/jf-tech/omniparser/blob/master/extensions/omniv21/samples/csv2/1_single_row.schema.json let's say we add a new 'line_num' in the final output:
So basically the Note, each different format (csv2, fixedlength2, edi, etc) will probably have different subnodes/fields underneath their own corresponding This design is flexible enough. The problem I don't like is discoverability - no one would know about this What do you think? I need sometime to think over it as well. |
Yes, this is exactly what I am looking for. We are using CSV2 and getting _metainfo would be super helpful. I see what you are saying about potential conflicts. Would it help reduce conflicts if there was a way to enable/disable _metainfo? That might reduce the conflicts if someone has _metainfo as a column name. Just a thought. |
@emily-coffin PR is out, can you clone the branch https://github.com/jf-tech/omniparser/tree/debug_setting and give it a test? And let me know if this is what you are looking for? Thanks! |
@jf-tech I just tested it out this morning and it works great! This is exactly what I am looking for. Thank you! |
@emily-coffin merged to master and issue closed. please do consider a sponsorship of any size would be highly appreciated! |
@jf-tech I am pretty new to golang but I assume this change will not be available in the go mod until a new tag is released. Is this correct? |
Not necessarily, you can always pull from the latest on master:
|
@jf-tech sorry for taking so long to get back. I tried that and it did not work. I keep getting an error: |
@jf-tech I was able to get it to work. I had to use |
Is there a way to get the CSV row index to show in the transform declarations for each declaration object? This will help with future debugging if an issue occurs so we know what line within the source CSV file to refer to.
The text was updated successfully, but these errors were encountered: