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

"Write date to csv"

javemarjavemar Member Posts: 23 Contributor II
edited June 2019 in Help
Hello


I am exporting a data set that have dates in some attributes. My datasample is long enought (more than 70.000 examples) to write a excel file, so I considered to write a csv. However, Now I have the problem that I dont can't retrive all the values as a dates(Some values are writing as a text). Please, can anybody give me a tip.


Thanks.
Tagged:

Answers

  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Hi,

    with which tool are you trying to retrive the values from the CSV file? If you are using RapidMiner with Read CSV, please be sure to define the date column as type "date", and set the date format correctly if necessary.

    Best, Marius
  • javemarjavemar Member Posts: 23 Contributor II
    Hello

    Well, I retrieved all the information with the "read database" operator. I set up a break point on this operator and the metadataview show me the types of the attributes in the right way, I mean, all the dates as a date data type. However, writing to csv give me problems. I saw that the problems sometimes happens when I have a date with a month menor to ten. For example, if I have the next date (10/25/2008) the csv file show me a date, but if I have a 1/28/2008 I get a text. I suppose the problem is related with the initial zero, but I haven't been able to solve this problem.

    Thanks Marius
  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    You still did not tell us how you are reading the csv file. In a text editor, of course everything is text - that's the nature of csv files. So how are you processing your file? Importing it to excel? Re-importing it to RapidMiner? Anything totally different?

    Best,
      Marius
  • javemarjavemar Member Posts: 23 Contributor II
    Hello Marius. I didnt understand you, please excuse me.


    The first time, I opened the csv with excel 2010 and the got the error that I told you. Today i tried with the read csv operator of rapid miner and I got missing values from the attributes with dates.

    Thanks for your replies Marius

  • javemarjavemar Member Posts: 23 Contributor II
    I think I solved my problem. First thing that I did was change the attribute from date to nominal with de "date to nominal" operator and then write a csv. The format that worked for my was 'dd/MM/yyyy HH:mm'. Now I can read in Excel.



  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Okaaay, your very last sentenced is what I missed during all your previous posts - that you wanted to import the file in Excel :)

    However we're happy that you managed to get it right!

    Best,
      ~Marius
Sign In or Register to comment.