<?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: Import csv with multiple time formats? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735076#M91595</link>
    <description>&lt;P&gt;I would import that column as text and then write a formula which is able to convert all the different date formats to datenum. You can then change the format of that formula column to present date/time.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 17:03:25 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-03-14T17:03:25Z</dc:date>
    <item>
      <title>Import csv with multiple time formats?</title>
      <link>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735067#M91589</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I'm wondering if there's a way in JMP to import a csv whose datetime column contains multiple formats? &amp;nbsp;Or alternatively, does anyone have a clever script to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have vendors that supply us data as csv files. &amp;nbsp;They are not always careful about following a consistent datetime format. &amp;nbsp;The problem occurs when this format changes within a single csv. &amp;nbsp;For instance, rows 1-1546 might appear in the format "m/d/yy hh:mm", and rows 1547-3457 might appear in the format "yyyy/mm/dd hh:mm:ss'. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I can import the csv and force the datetime column to remain as text, either using the preview editor, or using Multiple File Import. &amp;nbsp;But ultimately I need to convert this column to numeric, and I can't find smooth way to do this that doesn't result in some rows having missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've considered splitting the data file into multiple parts based on the format, then manually converting each to the correct format, but this is too time-intensive. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any ideas, or a script I can borrow? &amp;nbsp;Thanks!&lt;/P&gt;&lt;P&gt;-Stefan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Details:&lt;/P&gt;&lt;P&gt;JMP Pro 17.2.0&lt;/P&gt;&lt;P&gt;Mac OS Ventura 13.6.4&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:39:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735067#M91589</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2024-03-14T16:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with multiple time formats?</title>
      <link>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735072#M91592</link>
      <description>&lt;P&gt;Try this.&amp;nbsp; Import :Date as a character column and create a new column :Standardized Date.&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;New Column( "Standardized Date",
	Numeric,
	"Continuous",
	Format( "m/d/y h:m:s", 23, 0 ),
	Formula( Num( :Date ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As long as the :Date values are all valid, this works great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmarchandTSI_0-1710435734167.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62199iDFD08C7E0AFE477D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mmarchandTSI_0-1710435734167.png" alt="mmarchandTSI_0-1710435734167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:02:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735072#M91592</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2024-03-14T17:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with multiple time formats?</title>
      <link>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735076#M91595</link>
      <description>&lt;P&gt;I would import that column as text and then write a formula which is able to convert all the different date formats to datenum. You can then change the format of that formula column to present date/time.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:03:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735076#M91595</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-14T17:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Import csv with multiple time formats?</title>
      <link>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735080#M91598</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt;&amp;nbsp;. &amp;nbsp;Elegant and easy solution.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:02:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-csv-with-multiple-time-formats/m-p/735080#M91598</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2024-03-14T18:02:07Z</dc:date>
    </item>
  </channel>
</rss>

