This content has been marked as final. Show 2 replies
You could use 'as' to create an alias on each column then use this to identify a column.
Or you could write a parser that will only delimit when:
1) the current character is , and
2) there are no open braces or quotation marks.
You can check 2 by using a simple counter that increments each time a ( is reacher and decrements each time a ) is reached. when the counter is zero you know you are outside the braces.
Beware of further pitfalls though such as cases when ( is not a ( but a string such as substring('(')
I highly recommend you take a look at javacc.