Hi, I have an application that reads in information files in text format. Each line is made up of some character delimited fields and one of these fields is a date field. This information files come from can come from different sources and can have different formats, ie the columns in different orders and the date in different formats.
The file will always be the in same format from a particular source so I wrote a utility into my program that you can run which lets to create a defintion file which maps the column data in the file to the appropriate field in the application, so when you import you just choose the right definition and it reads everything correctly.
The problem is with the date. It can possibly come in many different formats. Is there any way to determine the date from a
string if you are unsure of the format when it is accessed? So if "2004-04-15" was brought in as a string the applicaiton would parse that as year 2004, march 15. I know you can use SimpleDateFormat to parse strings into dates but it requires you to know the format in advance. Anyone have any recommendations on how I should handle this?
Any help is appreciated.