question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic or Untyped Mappings and Output

See original GitHub issue

Thanks for what looks to be a great library! I’m creating an application that needs to do some CSV processing without knowing either the mappings or the structure of the input data at compile-time. At runtime I have both the input data (of course) and the mapping information (each of the destination columns and whether I should pull them from a column in the source or provide a default or static value).

So I have two questions:

  1. Is there a way to construct the mapping object for TinyCsvParser at runtime? I guess I could construct a runtime expression manually using Linq. It would help if there were an overload to the mapping to pass in the column names as strings instead of just expressions (especially since it currently looks like the expressions are just mapped back to strings through reflection eventually).
  2. Is there a way to receive some dynamic or IEnumerable<KeyValuePair<string, string>> (for header -> value) back from TinyCsvParser?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
bytefishcommented, Apr 7, 2019

Dynamic Mappings would be a great feature, but I am lacking the resources to implement it in the near future. Right now I prefer to have the library with fixed mappings. For sophisticated mappings people will turn to CsvHelpers anyway. This library is optimized for speed, so maybe this is what it should be known for.

I don’t want to generate false expectations, like users can expect me to support dynamic mappings sometime soon. So I am closing this issue.

Sorry! 🙏

1reaction
josh75337commented, Jan 5, 2018

How do you recreate this warning? I downloaded the 2.1 branch and set it up and ran the unit test and did not get that warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic or Untyped Mappings and Output · Issue #23
Basically I defined a CsvMappingBuilder , which allows to build mappings by the Column Name. When you have the Header, you can instantiate...
Read more >
What is the supposed productivity gain of dynamic typing?
Both dynamic typing and static typing have their advantages. ... And some of them even allow embedding untyped code, whenever you need to ......
Read more >
Ho to dynamically deserialize untyped a JSON with list
A JSON object deserializes to a Map<String, Object> . At run time, the contents of the Map (the Object instances) will have a...
Read more >
c# - Changing a csv file, reading and writing with dynamic ...
If all you are doing is changing CSV characteristics (like ticks etc) rather than the data, couldnt you just read the raw fields...
Read more >
Using Dynamic Transforms (Mapping) in Biztalk 2004 ...
Dynamic mapping is the concept of specifying the map to be used for a transform at runtime inside the orchestration.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found