In the specified example, the delimiter is TAB. Many web APIs allow customization of the delimiter character, and in order to provide a generic parser, sometimes it is way easier to define a delimiter as a variable, and not need to create a long nested structure with IF-THEN-ELSE-IF-ELSE constructs:
Imagine that based on setup on API side (out of our control) the content can be delivered via tab or semicolon, e.g.
Let's save this response into a variable and see the code, which we will need to write depending on the setup:
The if-else block is constantly growing, especially if we want to customize quote, escape, delimiter, and row delimiter.
Thus it would be great if we could make these values configurable. In this case, we could end up with this expected code, which is more readable and more easily customizable:
With a bit of tweaking and certain assumptions, leading in the trust level, we can even read the first line and try to auto-detect the delimiter automatically (e.g. by counting tabs, commas, and semicolons in the first line).
Please, could you be so kind as to make HEADER and SKIP values customizable (rather than hardcoded numbers)?