<?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 JMP16 Using Custom Date Formats In Scripts in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409162#M65891</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a data table in which the date is formatted as such:&amp;nbsp;15/09/08/19:12 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to convert this using the custom format feature in the data table editor with the following:&amp;nbsp;&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt; but via script I cannot figure how to get this to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an exert of the script, any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luke&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;path = Get Default Directory(); 
dt = Pick File("Select .csv file with  data", path, {"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, ""); 


Open(dt,
	columns(
		New Column( "; DateTime", Numeric, "Continuous", Format( "y/m/d h:m"),Input Format( "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;", 3 )),
		New Column( "Machine ID", Character, "Nominal" ),
		New Column( "Z/Xrmv_max", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "Z/Xrmv_min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "Z/Xrmv_max-min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_max", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_max-min", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 1 ) ),
		Strip Quotes( 0 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;LI-PRODUCT title="JMP" id="jmp"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:35:20 GMT</pubDate>
    <dc:creator>LukeFarrell</dc:creator>
    <dc:date>2023-06-10T23:35:20Z</dc:date>
    <item>
      <title>JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409162#M65891</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a data table in which the date is formatted as such:&amp;nbsp;15/09/08/19:12 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to convert this using the custom format feature in the data table editor with the following:&amp;nbsp;&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt; but via script I cannot figure how to get this to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an exert of the script, any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Luke&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;path = Get Default Directory(); 
dt = Pick File("Select .csv file with  data", path, {"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, ""); 


Open(dt,
	columns(
		New Column( "; DateTime", Numeric, "Continuous", Format( "y/m/d h:m"),Input Format( "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;", 3 )),
		New Column( "Machine ID", Character, "Nominal" ),
		New Column( "Z/Xrmv_max", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "Z/Xrmv_min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "Z/Xrmv_max-min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_max", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_min", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "P/Xrmv_max-min", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 1 ) ),
		Strip Quotes( 0 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 1 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;LI-PRODUCT title="JMP" id="jmp"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:35:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409162#M65891</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2023-06-10T23:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409178#M65893</link>
      <description>&lt;P&gt;Syntax when using Format pattern is a bit different. Try something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Format("y/m/d h:m"),
Input Format("Format Pattern", "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Example table&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table("Untitled",
	Add Rows(1),
	New Column("Column 1",
		Numeric,
		"Nominal",
		Format("y/m/d h:m"),
		Input Format("Format Pattern", "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;"),
		Set Selected,
		Set Values([3061825920]),
		Set Display Width(89)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Aug 2021 15:18:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409178#M65893</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-08-12T15:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409201#M65895</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still a having issues where the column still is giving null results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LukeFarrell_0-1628782208187.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34967i0DC325682E1D349B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LukeFarrell_0-1628782208187.png" alt="LukeFarrell_0-1628782208187.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The column is changing to the desired format as if performing manually. Could it be because the original column name is not changing due to the name being "; The schema definition " ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 15:34:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409201#M65895</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2021-08-12T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409234#M65898</link>
      <description>&lt;P&gt;If you try importing it first as character, what does it look like? Only empty cells?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "; DateTime", Character, "Nominal),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 15:55:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409234#M65898</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-08-12T15:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409238#M65899</link>
      <description>&lt;P&gt;If taken as Character we get the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LukeFarrell_0-1628784004593.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34970i120C7C71D13843B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LukeFarrell_0-1628784004593.png" alt="LukeFarrell_0-1628784004593.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, in regards to my previous reply, I edited the original csv and removing the ";" does not change the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 16:01:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409238#M65899</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2021-08-12T16:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409242#M65900</link>
      <description>&lt;P&gt;I created quick test.csv with only couple of rows and used the option to directly modify it in the import platform:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1628784611221.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34971i5AE8A1EB3285AF38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1628784611221.png" alt="jthi_0-1628784611221.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"$DOCUMENTS/JMP/test.csv",
	columns(
		New Column("time",
			Numeric,
			"Continuous",
			Format("Format Pattern", "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;", 14),
			Input Format("Format Pattern", "&amp;lt;YY&amp;gt;/&amp;lt;MM&amp;gt;/&amp;lt;DD&amp;gt;/&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;")
		)
	),
	Import Settings(
		End Of Line(CRLF, CR, LF),
		End Of Field(Comma, CSV(0)),
		Strip Quotes(1),
		Use Apostrophe as Quotation Mark(0),
		Use Regional Settings(0),
		Scan Whole File(1),
		Treat empty columns as numeric(0),
		CompressNumericColumns(0),
		CompressCharacterColumns(0),
		CompressAllowListCheck(0),
		Labels(1),
		Column Names Start(1),
		Data Starts(2),
		Lines To Read("All"),
		Year Rule("20xx")
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So maybe the "result" format must also be done with Format Pattern?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 16:10:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409242#M65900</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-08-12T16:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: JMP16 Using Custom Date Formats In Scripts</title>
      <link>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409243#M65901</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, thank you so much! That has worked and has fixed the issue!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 16:15:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP16-Using-Custom-Date-Formats-In-Scripts/m-p/409243#M65901</guid>
      <dc:creator>LukeFarrell</dc:creator>
      <dc:date>2021-08-12T16:15:00Z</dc:date>
    </item>
  </channel>
</rss>

