cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Herrera5238
Level III

How to replace "." or "-" character to "/"

Hello,

I started a script that imports multiple excel files into one table. The date field has a mix of formats; mm/dd/yyyy , mm.dd.yy and mm-dd-yy.

I tried using recode, and looking at the script it looks like static values:

Current Data Table() << Begin Data Update;
dc1 = New Column( :Date );
dc1 << Set Name( "Date 3" );
Current Data Table() << Go to( dc1 );
Current Data Table() << Move Selected Columns( after( :Date ) );
For Each Row(
dc1[] = Match( :Date,
"10.11.18", "10/11/18",
"10.16.18", "10/16/18",
"10.20.18", "10/20/18",
"10.21.18", "10/21/18",
"10.24.18", "10/24/18",
"11-01-18 A1", "11/01/18 A1",
"11.08.18", "11/08/18",
:Date
)
);
Current Data Table() << End Data Update;

Essentially what I'm looking for as my end result is having all the dates formatted in a short date format, mm/dd/yy.

I need help making this code work for any new values that may be added later or maybe there is a better way to do it?

 

1 REPLY 1

Re: How to replace "." or "-" character to "/"

This is a common issue for users. A search of previous discussions will find a few solutions that might suit you. Here is one discussion from which you can adapt an answer.

Recommended Articles