The CSV file linked below has 3 columns: "PT_ID" (char 4), "PHYS_ID" (char 2) and "VISIT_START_TIME" (varchar eg "0:00:15" hours minutes seconds)
"https://docs.google.com/spreadsheet/pub?key=0AqPfEWYQJhXSdGF4ck5pblVlaHB0bkE0MWhsOWZ6M2c&output=csv"
Import["https://docs.google.com/spreadsheet/pub?key=\
0AqPfEWYQJhXSdGF4ck5pblVlaHB0bkE0MWhsOWZ6M2c&output=csv",
"DateStringFormat" -> {"Hour", ":", "Minute", ":", "Second"},
"Numeric" -> False]
Setting "Numeric" -> False
will result in this output, so the hh:mm:ss is not matched
{Q001,01,0:12:15}
While setting "Numeric" -> True
results in the following 2 seemingly unrelated problems:
{Q001,1,{2014,1,1}}
- "PHYS_ID" is cast to
Integer
- the 3-element List contains Year, Month, Day rather than Hours, Minute, Second
Are there obvious solutions to both 1 and 2?
http://reference.wolfram.com/mathematica/ref/format/CSV.html isn't very usable.
EDIT (based on answers/comments):
If it is known a priori which elements (columns) should be handled (here column 3, rows >=2), then using "Numeric"->False but not using DateStringFormat, the data can be post-processed using:
MapAt[DateList[#][[4 ;;]] &, tmp, {2 ;;, 3}]
But the ideal is to have Import deal with it given the documented options in CSV.
DateStringFormat almost works. Used along with "Numeric"->True, it incorrectly returns the first 3 elements of DateList@"0:12:15" --> {2014, 1, 1, 0, 12, 15.} rather than the entire list. But if DateStringFormat is not used (and with "Numeric" -> True), then "0:12:15" is imported as-is (String).
output=csv
that it is a text-based CSV file. If not disregard that request; I'll try again later, or hopefully someone will have already solved your problem. $\endgroup$