<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I prevent 3-digit version numbers from getting read as dates into data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250279#M49128</link>
    <description>&lt;P&gt;Use Multiple File Import. It will not try to guess date formats. It will import one file at a time if that's all you select, but it is really targeted at importing a bunch of similar files from a folder. Look at the source script from a manual import if you need to repeat the process.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Mar 2020 02:12:07 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-03-03T02:12:07Z</dc:date>
    <item>
      <title>How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250195#M49116</link>
      <description>&lt;P&gt;In JMP 14.2.0, when I read in (or 'Open') a CSV file that contains a column with 3-digit version number values, those values get interpreted as a date. &amp;nbsp;For example, if verTest.csv contains:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Product,Station,Version,Date
Widget,Audio-Test,2.2.2044,3/2/19
Widget,RF-Test,2.2.2045,3/2/20&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;all the column values get interpreted as expected except the Version values which get read in as dates, e.g., 2/2/2044 and 2/2/2045, with Numeric data type, Continuous modeling type, and with the m/d/y format. &amp;nbsp;I find that 2-digit and 4-digit version numbers are read ok, that is, as character strings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A further complication is that I don't know in advance which columns might contain this format, so I can't explicitly set the column types ahead of time, (nor is it clear that it's even possible to set the column types prior to opening a CSV file). &amp;nbsp;And if I try to manually change the column types after the fact, it seems that the '/' characters are baked in such that changing the type to Character leaves the value with a "2/2/2044" string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to inhibit this interpretation so that 3-digit version numbers read in as strings, i.e., Character, Nominal, (and without affecting how dates are interpreted using the traditional formats such as m/d/y)?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 19:55:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250195#M49116</guid>
      <dc:creator>SteveTerry</dc:creator>
      <dc:date>2020-03-02T19:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250252#M49123</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/17813"&gt;@SteveTerry&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;When you open the .csv from with in JMP, you should have some options on the navigation window (at least for Windows.&amp;nbsp; I don't have a Mac).&amp;nbsp; Choose Data (Using Preview) and you will have an opportunity to manually set formats for imported columns.&amp;nbsp; Here's what it looks like in Windows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="OpenFile.PNG" style="width: 743px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22089i74C850E971809230/image-size/large?v=v2&amp;amp;px=999" role="button" title="OpenFile.PNG" alt="OpenFile.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you click Open, you'll get a series of dialog screens to set parameters for the import.&amp;nbsp; On the second screen, you can click at the top of the preview by the header you want to change and make sure that that column is imported as a character column.&amp;nbsp; Once you import it the way you like, you can just copy the Source script from the table and re-use it in the future to automate the import.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 21:14:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250252#M49123</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2020-03-02T21:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250273#M49126</link>
      <description>&lt;P&gt;Hi Cameron,&lt;/P&gt;&lt;P&gt;Thank you for your response. &amp;nbsp;Per your suggestion, on the last import screen, I was able to click the icon to the left of the red arrow to change it from a Numeric data column to a Character data column. &amp;nbsp;With that, it imported the data as I had wanted it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SteveTerry_1-1583186145597.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22091i7464BA7E4C3A0323/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SteveTerry_1-1583186145597.png" alt="SteveTerry_1-1583186145597.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The source for this gave me the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"&lt;SPAN&gt;/Users/st/src/analysis_jmp/&lt;/SPAN&gt;testVer.csv",
	columns(
		New Column( "Product", Character, "Nominal" ),
		New Column( "Station", Character, "Nominal" ),
		New Column( "Version", Character, "Nominal" ),
		New Column( "Date",
			Numeric,
			"Continuous",
			Format( "m/d/y", 10 ),
			Input Format( "m/d/y" )
		)
	),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This indicates that&amp;nbsp;&lt;SPAN&gt;it's possible to set the column types prior to opening a CSV file. &amp;nbsp;However, when I target just the Version column within my JSL script, things go haywire – (JSL bug maybe??).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My script:&lt;/SPAN&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;path = "./verTest.csv";&lt;BR /&gt;dt = Open(
	path,
	columns(
		New Column( "Version", Character, "Nominal" )
	),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Resultant source:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"/Users/st/src/analysis_jmp/verTest.csv",
	columns(&lt;BR /&gt;        New Column( "Product", Character, "Nominal" )&lt;BR /&gt;    ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thus, it looks like the importer disregards the name in the New Column specification and simply takes them in order of appearance in the file, ('Product' being the first one – I added a second New Column with similar results thus strengthening this hypothesis).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if this did work, it would presume I knew the name of the column in advance of the import, (which I don't). &amp;nbsp;In some cases I do, so I could at least apply this logic (assuming it worked) for those; &amp;nbsp;but I would eventually miss some of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping there might be an import option that would limit or constrain how dates are interpreted generally, (so that '.' characters are not considered as m/d/y delimiters, for example).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 22:21:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250273#M49126</guid>
      <dc:creator>SteveTerry</dc:creator>
      <dc:date>2020-03-02T22:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250279#M49128</link>
      <description>&lt;P&gt;Use Multiple File Import. It will not try to guess date formats. It will import one file at a time if that's all you select, but it is really targeted at importing a bunch of similar files from a folder. Look at the source script from a manual import if you need to repeat the process.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 02:12:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250279#M49128</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-03-03T02:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250729#M49220</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you so much for the suggestion! &amp;nbsp;I implemented &lt;FONT face="courier new,courier"&gt;Multiple File Import&lt;/FONT&gt; and have been testing it heavily; &amp;nbsp;I can't find any issues, and it's reading in my 3-digit &lt;FONT face="courier new,courier"&gt;Version&lt;/FONT&gt; column (and others like it) with the delimiters intact, but still reads the dates in correctly.&lt;/P&gt;&lt;P&gt;From the source produced by the manual &lt;FONT face="courier new,courier"&gt;Multiple File Import&lt;/FONT&gt;, I got the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Multiple File Import(
	&amp;lt;&amp;lt;Set Folder( "./" ),
	&amp;lt;&amp;lt;Set Name Filter( "verTest.csv" ),
	&amp;lt;&amp;lt;Set Name Enable( 1 ),
	&amp;lt;&amp;lt;Set Size Filter( {100, 100} ),
	&amp;lt;&amp;lt;Set Size Enable( 0 ),
	&amp;lt;&amp;lt;Set Date Filter( {3666002110.40841, 3666002110.40841} ),
	&amp;lt;&amp;lt;Set Date Enable( 0 ),
	&amp;lt;&amp;lt;Set Add File Name Column( 0 ),
	&amp;lt;&amp;lt;Set Add File Size Column( 0 ),
	&amp;lt;&amp;lt;Set Add File Date Column( 0 ),
	&amp;lt;&amp;lt;Set Import Mode( "CSVData" ),
	&amp;lt;&amp;lt;Set Charset( "Best Guess" ),
	&amp;lt;&amp;lt;Set Stack Mode( "Table Per File" ),
	&amp;lt;&amp;lt;Set CSV Has Headers( 1 ),
	&amp;lt;&amp;lt;Set CSV Allow Numeric( 1 ),
	&amp;lt;&amp;lt;Set CSV First Header Line( 1 ),
	&amp;lt;&amp;lt;Set CSV Number Of Header Lines( 1 ),
	&amp;lt;&amp;lt;Set CSV First Data Line( 2 ),
	&amp;lt;&amp;lt;Set CSV EOF Comma( 1 ),
	&amp;lt;&amp;lt;Set CSV EOF Tab( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Space( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Spaces( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Other( "" ),
	&amp;lt;&amp;lt;Set CSV EOL CRLF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL CR( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL LF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL Semicolon( 0 ),
	&amp;lt;&amp;lt;Set CSV EOL Other( "" ),
	&amp;lt;&amp;lt;Set CSV Quote( "\!"" ),
	&amp;lt;&amp;lt;Set CSV Escape( "" )
) &amp;lt;&amp;lt; Import Data;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To integrate that into my import function (which takes the &lt;FONT face="courier new,courier"&gt;path&lt;/FONT&gt; as a parameter), I only had to populate the first two methods correctly:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Convert_csv_to_jmp = Function( {path},
	:
	:
	// determine folder and file args for Multiple File Import function.
	lastSlash = Contains( path, "/", -1 );
	dir = Substr( path, 1, lastSlash );
	If( Length(dir) == 0,
		dir = "./";
	);
	file = Substr( path, lastSlash+1 );
	Write( "Path:  ", dir, "\!nFile:  ", file, "\!n" );

	Multiple File Import(
		&amp;lt;&amp;lt;Set Folder( dir ),
		&amp;lt;&amp;lt;Set Name Filter( file ),  // import files with this name.
		:&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would appreciate if someone from the community could link to some good documentation on this function. &amp;nbsp;I would like to understand what all the methods are doing. &amp;nbsp;For example,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Set Date Filter&lt;/FONT&gt;&amp;nbsp;appears to want some very arcane arguments.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 03:49:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250729#M49220</guid>
      <dc:creator>SteveTerry</dc:creator>
      <dc:date>2020-03-05T03:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250775#M49228</link>
      <description>&lt;P&gt;Glad that is working for you!&lt;/P&gt;&lt;P&gt;The syntax serves three purposes: remembering the full state of the dialog if you want to re-launch the dialog with pre-populated values, running the import, and showing the possibilities. The filters are an example of all of those:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	&amp;lt;&amp;lt;Set Name Filter( "verTest.csv" ),
	&amp;lt;&amp;lt;Set Name Enable( 1 ),
	&amp;lt;&amp;lt;Set Size Filter( {100, 100} ),
	&amp;lt;&amp;lt;Set Size Enable( 0 ),
	&amp;lt;&amp;lt;Set Date Filter( {3666002110.40841, 3666002110.40841} ),
	&amp;lt;&amp;lt;Set Date Enable( 0 ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Comparing that to the dialog,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="using &amp;lt;&amp;lt;CreateWindow instead of &amp;lt;&amp;lt;ImportData" style="width: 828px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22176i3211652ABED1D1F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="using &amp;lt;&amp;lt;CreateWindow instead of &amp;lt;&amp;lt;ImportData" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;using &amp;lt;&amp;lt;CreateWindow instead of &amp;lt;&amp;lt;ImportData&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;there are check boxes in the dialog that enable and disable the filter. Above, the name filter is enabled and the size and date filters are not in use. The values in the size and date filters are either (1) the last values you experimented with, or (2) the size range and date range of the file you selected. Most likely (2). So your file is probably 100 bytes long. The number is a JMP date-time value, you can use something like asdate(&amp;nbsp;&lt;CODE class=" language-jsl"&gt;3666002110.40841&lt;/CODE&gt; ) to get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;02Mar2020:13:55:10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can delete those lines and (probably) many others from the script; they are mostly default values that show how to use MFI.&lt;/P&gt;&lt;P&gt;Finally, what the script is really doing: the MFI(...) function returns an object. The &amp;lt;&amp;lt;&lt;EM&gt;ImportData&lt;/EM&gt; method at the very end tells the object to actually import the data. There is an example in the Scripting Index that shows&amp;nbsp;&amp;lt;&amp;lt; &lt;EM&gt;CreateWindow&lt;/EM&gt; as another method. The MFI object is used immediately and then destroyed in the &amp;lt;&amp;lt;&lt;EM&gt;ImportData&lt;/EM&gt; case. In the &amp;lt;&amp;lt;&lt;EM&gt;CreateWindow&lt;/EM&gt; case the MFI object is not destroyed until the window closes. You can also use xyz = MultipleFileImport(...); and send messages to the variable xyz (including &lt;EM&gt;ImportData&lt;/EM&gt; and &lt;EM&gt;CreateWindow&lt;/EM&gt;); the object won't be destroyed until the variable is cleared. ShowProperties(xyz) will list the messages to the log window; they are used in the script too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 12:45:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250775#M49228</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-03-05T12:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I prevent 3-digit version numbers from getting read as dates into data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250778#M49229</link>
      <description>&lt;P&gt;...and you can use dates like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	&amp;lt;&amp;lt;Set Date Filter( {2jan2020, 10jan2020} ),
	&amp;lt;&amp;lt;Set Date Enable( 1 ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="&amp;lt;&amp;lt;CreateWindow with pre-populated date range" style="width: 678px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/22177iCD46A1B8441D46F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="&amp;lt;&amp;lt;CreateWindow with pre-populated date range" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;&amp;lt;&amp;lt;CreateWindow with pre-populated date range&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 12:59:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-prevent-3-digit-version-numbers-from-getting-read-as/m-p/250778#M49229</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-03-05T12:59:21Z</dc:date>
    </item>
  </channel>
</rss>

