Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

My file. Txt has only two columns, where the 1st column is the time that the data was generated by the 2nd column has decimal values ​​1-100.

Example:

19/06/2013 at 14:31:43 ------ 75 .19
19/06/2013 at 14:31:54 ------ 62 .46
19/06/2013 at 14:32:04 ------ 55 .62
19/06/2013 at 14:32:14 ------ 48 .28
19/06/2013 at 14:32:24 ------ 33 .15

I would like to plot this data on a graph that represents the axis yo time on the x axis while the decimal values ​​... these graphics could be in columns in which the maximum value is 100.

share|improve this question

marked as duplicate by Yves Klett, m_goldberg, Michael E2, belisarius, rm -rf Jun 27 '13 at 3:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
is there really a space between the numbers (75SPACE.19) –  george2079 Jun 25 '13 at 16:35

2 Answers 2

up vote 2 down vote accepted

I assume you do not really have those spaces.. if you do its not much trouble to fix..

fdate[r_] := 
    DateList[ 
       Join[
           Reverse@(Read[StringToStream[#], Number] & /@ 
                              StringSplit[ r[[1]] , "/"]), 
                   (Read[StringToStream[#], Number] & /@ 
                              StringSplit[ r[[3]], ":"])]];

 DateListPlot[{fdate[#] , #[[5]]} & /@ Import["C:....file.txt", "Table"]]

enter image description here

if you do have the stray spaces just add the two columns like this:

 DateListPlot[{fdate[#] , Plus@@#[[5;;6]]} & /@ Import["C:....file.txt", "Table"]]

Edit -- I understimated the power of datelist.. This does the same:

fdate[r_] :=  DateList[{r[[1]] <> " " <> r[[3]], 
       {"Day", "Month", "Year", "Hour",  "Minute", "Second"}}]
share|improve this answer

Use Import["file","Table"] to import data. In your case "file" should be "name.txt", You can use ListPlot[{{x1, y1}, {x2, y2}, ...}], where 'x' is the decimal value and 'y' is time.

But really I have no idea how to input date and time simultaneously in 'y'. You may use number as a symbol of time, because time is not repeated value, you identify them easily.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.