Open khuzayfa opened 5 years ago
Is the column always in the same position? If it is you can map its index. Another option is to read the first line to manually determine the headers, then map the headers to their positions. It's a bit more work but you can do it without a regex right now.
I'll look into using regex for matching headers in version 3.0.0.
Thank you for using our parsers!
Thank you for your answer. Column names for different clients have different positions. So matching by position is not an option for me. Regarding the parsing first line of file or header, I thought about that and was considering it as an option if I cannot find better way of solving the question and thus first wanted to ask from authors.
Hi, I have seen the closed issue #287 . I have similar case, but in my situation column name for one attribute of POJO frequently changes. Let's say I am receiving every week or month some file where I have a column <Passed Orders (July 2019)>. My application parses this csv file with BeanListProcessor to the desired POJO instances. However, next time I will receive a file where that same column would change to <Passed Orders (August 2019)> and this keeps happening every fixed period. Every time when I have such situation it is not that efficient (and some times feasible) to modify the code (either using the solution from #287 or using @Parsed annotations). So, I wanted to ask, is it possible to add some regex style expression to the parsing annotation or to the solution from #287, so that I will just look for the column %Passed Orders%. I may have other aliases/names to the same column for new costumers, so solution similar to @Parsed annotation with (fields = {}) would be the best, but I am open to other ideas as well.