The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"CSV Import Date-Time formatting problem"
hughesfleming
Member Posts: 14 Contributor II
Hi,
I have a question about how to format time when I import a csv consisting of intraday forex data. I have duplicated the neuralmarket trends tutorial 10 using forex data exported from metatrader. Everything works for daily data when I import using yyyy-MM-dd and deselect time. Now I am trying to import four hour data with date,time,input,input,input,input as the header but when I format time as hh:mm:ss I get an error. Also at this point is there a way to combine date and time into one column and assign an id to that combination? I have looked at the documentation with regards to formatting date and time in java but I can't seem to get this to work.
Many thanks,
Alex
I have a question about how to format time when I import a csv consisting of intraday forex data. I have duplicated the neuralmarket trends tutorial 10 using forex data exported from metatrader. Everything works for daily data when I import using yyyy-MM-dd and deselect time. Now I am trying to import four hour data with date,time,input,input,input,input as the header but when I format time as hh:mm:ss I get an error. Also at this point is there a way to combine date and time into one column and assign an id to that combination? I have looked at the documentation with regards to formatting date and time in java but I can't seem to get this to work.
Many thanks,
Alex
Tagged:
0
Answers
If you check out the Date to Numerical operator you'll see that it
So... you could try getting the millseconds for the Date ( nasty calculation ) and then adding the appropriate for your time portion, finally you can convert back to the Date format to unify things. At least in some parallel universe perhaps.
Timestamps are a pain, and one of the reasons I use SQL servers.
Hope that helps
I am surprised that this is not straight forward. I may try exporting the csv in a different way. I am running an indicator that exports training data and then out of sample data to two files. The out of sample file gets updated more or less in realtime and then the two files are imported into rapidminer. I could probably do the same thing with mysql if that would make life simpler but that adds another layer that I am hoping to avoid.
regards,
Alex
Can I just ignore this and drop date and time all together and just bring in the numeric data?
Alex
Alex
For future reference you may find this page useful, it lays out the Java datetime format strings http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html.
To try and emulate your problem I set up a text file with the contents of an SQL timestamp, like this.. and was able to import it as a datetime, like this.. Note the '.SSS' for milliseconds in the format string.
If you want to join date and time stamps I think you need to sum their milliseconds and convert back to a datetime, as I explained before.
I modified the exporter to follow your example and everything is working.
Kind regards,
Alex