loading date in datafile

mwpro
Posts: 87
Joined: 2015-03-18
Location: United States

Hello! I am getting blank wave trying to load a date entry, may I get some help? My code is like this

LoadWave/Q/A/J/D/O/W/L={0,7,1,0,0}/B="C=1,F=-2,T=4;  C=1,F=6,T=4,N=StartDate;"/R={English, 2, 2, 1, 1, "Month/DayOfMonth/Year", 4}  pathname+fileName

and I have attached an example file. Thanks very much for the help!!

AttachmentSize
DT005.csv2.38 KB

[ last edited September 14, 2017 - 10:24 ]
Posts: 1693
Joined: 2007-06-21
Location: United States

You need "Year/Month/DayOfMonth" instead of "Month/DayOfMonth/Year".

For clarity and ease of debugging, I rewrote your code like this:

Function Test()
	String columnInfoStr = ""
	columnInfoStr += "C=1,F=-2,T=4,N='_skip_';"
	columnInfoStr += "C=1,F=6,T=4,N=StartDate;"
	String dateLayout = "Year/Month/DayOfMonth"
	LoadWave/Q/A/J/D/O/W/L={0,7,1,0,0}/B=columnInfoStr/R={English,2,2,1,1,dateLayout,4}
End


mwpro
Posts: 87
Joined: 2015-03-18
Location: United States

Thank you hrodstein! but I don't understand why the date-structure has year at the front, isn't my date data start from month, then day of month and the last would be the year? Thank you!


Posts: 1693
Joined: 2007-06-21
Location: United States

Take a closer look at line 7 of the attached file: 2017/07/01


JimProuty's picture
Posts: 664
Joined: 2007-07-19
Location: United States

A helpful trick in these kinds of situations is to open the .csv file in Igor as an unformatted notebook.

That way you see the file the way it really is, instead of the way Excel represents the file.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.


mwpro
Posts: 87
Joined: 2015-03-18
Location: United States

Thank you hrodstein and Jim, I did look at it in Excel and see the wrong format. That's why. Now I see. Thank you for the tricks!


Back to top