I am working for a java desktop application which parse logs and upload to server. We ask user to provide separator by which we parse CSV file and we read provided separator from text field in string and make a char by -
separator = (sTerminatedBy != null && !sTerminatedBy.equalsIgnoreCase("")) ? sTerminatedBy.charAt(0) : ' ';
because my parser code accepts separator in char.
The issue is when user provides "\t" then how can I provide separator in char to my parser. User can request to parse by any separator so can any body suggest what can I do to generic my code and can provide separator in char.