Search code examples
c#filehelpers

FileHelpers, how to separate text in multiple classes using only one line , identified by keys?


I have a text that is more or less like this:

I10JOAO OF SILVAI202210I30 ...

where : I10 is a key to the Person class I20 is a key to another class so on ...

How to proceed using the FileHelpers library?


Solution

  • Personally, I would suggest that you pre-parse the file into a temporarily file containing multiple lines which have the |10, |20, |xx prefix then use the record selection techniques described in the Avanced - Multi Record Selection.