cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • 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.

Discussions

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

Copy File Function

I am using JMP 12.

I just want copy five csv files with different name from A folder and save it in B folder.

The A folder contains many csv files.

Using Copy File function (as below), I can only copy one file at a time.

I need to write below script five time to copy all five files 

 

 

Copy File( "C:\A\data1.csv", "C:\B\data1.csv" );
Copy File( "C:\A\data2.csv", "C:\B\data2.csv" );
Copy File( "C:\A\data3.csv", "C:\B\data3.csv" );
Copy File( "C:\A\data4.csv", "C:\B\data4.csv" );
Copy File( "C:\A\data5.csv", "C:\B\data5.csv" );

 

 

Is there a way to copy multiples files using one Copy File function?

or, is there other function/script that I can use to achieve this objective?

 

Thank you for your help.

2 ACCEPTED SOLUTIONS

Accepted Solutions
pmroz
Super User

Re: Copy File Function

for (i = 1, i <= 5, i++,
	file1 = evalinsert("C:\A\data^i^.csv");
	file2 = evalinsert("C:\B\data^i^.csv");
	copy file(file1, file2);
);

View solution in original post

Georg
Level VII

Re: Copy File Function

just another approach using a filelist or copy directory function,

however tested under JMP 15 with Windows, I have no JMP12.

 

Names Default To Here( 1 );

source_dir = "$TEMP\ADIR";
destination_dir = "$TEMP\BDIR";

// Prepare a directory and some files
If( !Directory Exists( source_dir ),
	Create Directory( source_dir )
);
Save Text File( source_dir || "\afile.txt", "afile content" );
Save Text File( source_dir || "\bfile.txt", "bfile content" );
Save Text File( source_dir || "\cfile.txt", "cfile content" );

// Generate list of files
file_list = Files In Directory( source_dir );

// Prepare destination directory
If( !Directory Exists( destination_dir ),
	Create Directory( destination_dir )
);

// Copy all files from list
For( i = 1, i <= N Items( file_list ), i++,
	Copy File( source_dir || "\" || file_list[i], destination_dir || "\" || file_list[i] )
);

// Copy directory
Copy Directory( source_dir, "$HOME", recursive( 1 ) );

// see results
Open( "$TEMP" );
Open( "$HOME" );

 

 

 

Georg

View solution in original post

3 REPLIES 3
pmroz
Super User

Re: Copy File Function

for (i = 1, i <= 5, i++,
	file1 = evalinsert("C:\A\data^i^.csv");
	file2 = evalinsert("C:\B\data^i^.csv");
	copy file(file1, file2);
);
Georg
Level VII

Re: Copy File Function

just another approach using a filelist or copy directory function,

however tested under JMP 15 with Windows, I have no JMP12.

 

Names Default To Here( 1 );

source_dir = "$TEMP\ADIR";
destination_dir = "$TEMP\BDIR";

// Prepare a directory and some files
If( !Directory Exists( source_dir ),
	Create Directory( source_dir )
);
Save Text File( source_dir || "\afile.txt", "afile content" );
Save Text File( source_dir || "\bfile.txt", "bfile content" );
Save Text File( source_dir || "\cfile.txt", "cfile content" );

// Generate list of files
file_list = Files In Directory( source_dir );

// Prepare destination directory
If( !Directory Exists( destination_dir ),
	Create Directory( destination_dir )
);

// Copy all files from list
For( i = 1, i <= N Items( file_list ), i++,
	Copy File( source_dir || "\" || file_list[i], destination_dir || "\" || file_list[i] )
);

// Copy directory
Copy Directory( source_dir, "$HOME", recursive( 1 ) );

// see results
Open( "$TEMP" );
Open( "$HOME" );

 

 

 

Georg
bzanos
Level III

Re: Copy File Function

Thank you.

Recommended Articles