<?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: Importing multiple files in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482178#M72654</link>
    <description>&lt;P&gt;Only thing that quickly comes to my mind is that you are missing {} around the arguments of function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_and_modify = function(file_path, {Default Local},
	dt = Open(file_path, Worksheets("Table1"), XXX);

	// New operation e.g. New column: Column 2
	dt &amp;lt;&amp;lt; New Column("Column 2", Numeric, "Continuous", Format("Best", 12));
	dt &amp;lt;&amp;lt; Set Name("File1");
	return(dt);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;when it should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_and_modify = function({file_path}, {Default Local},
	dt = Open(file_path, Worksheets("Table1"), XXX);

	// New operation e.g. New column: Column 2
	dt &amp;lt;&amp;lt; New Column("Column 2", Numeric, "Continuous", Format("Best", 12));
	dt &amp;lt;&amp;lt; Set Name("File1");
	return(dt);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 14:04:31 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-04-26T14:04:31Z</dc:date>
    <item>
      <title>Importing multiple files</title>
      <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/480922#M72542</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my problem has probably been brought up before as it is quite basic but I couldn't find the solution to my exact problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to import multiple files with the same structure,&amp;nbsp; manipulate them in the identical way and then glue a subset of them together. I have done the importing and data manipulation part in the following generic way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
	"PATH/File1.xlsx",
	Worksheets( "Table1" ),
	XXX
);

// New operation e.g. New column: Column 2
dt &amp;lt;&amp;lt; New Column( "Column 2",
	Numeric,
	"Continuous",
	Format( "Best", 12 )
);&lt;BR /&gt;&lt;BR /&gt;File1 = dt;&lt;BR /&gt;File1 &amp;lt;&amp;lt; Set Name("File1");&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In order to import more files, I would copy the same code to the script and only exchange "File1" by "File2", "File3" and so on. It works but the script length gets quite big since I have a lot of files to import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried the IMF option. When I chose "Open multiple tables" (I don't want it stacked) I have the data tables already linked to specific names and couldn't get them manipulated with a the generic code described above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas for a more elegant solutions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:47:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/480922#M72542</guid>
      <dc:creator>NominalLogNewt5</dc:creator>
      <dc:date>2023-06-10T23:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple files</title>
      <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/480983#M72544</link>
      <description>&lt;P&gt;You could try using &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/programming-functions.shtml?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#ww5013741" target="_blank" rel="noopener"&gt;function() (jmp.com)&lt;/A&gt;&amp;nbsp; or expr(). Here are few options using&amp;nbsp; function():&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_and_modify = function({file_path}, {Default Local},
	dt = Open(file_path, Worksheets("Table1"), XXX);

	// New operation e.g. New column: Column 2
	dt &amp;lt;&amp;lt; New Column("Column 2", Numeric, "Continuous", Format("Best", 12));
	dt &amp;lt;&amp;lt; Set Name("File1");
	return(dt);
);

dt1 = open_and_modify("PATH/File1.xlsx");
dt2 = open_and_modify("PATH/File2.xlsx");
dt3 = open_and_modify("PATH/File3.xlsx");


//or have a list of paths
file_paths = {"PATH/File1.xlsx", "PATH/File2.xlsx", "PATH/File3.xlsx"};
//create first concatenate before 
table_list = {};
For Each({new_file_path}, files,
	Insert Into(table_list, open_and_modify(new_file_path));
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Apr 2022 15:28:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/480983#M72544</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-21T15:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple files</title>
      <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482074#M72645</link>
      <description>&lt;P&gt;Thanks for the quick answer. I tried to implement the code but always get the error message:&lt;/P&gt;&lt;P&gt;"argument should be list in access or evaluation of 'Function'" refering to the line 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;open_and_modify = function({file_path}, {Default Local},&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can you tell me what mistake I made? I always run into this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 07:29:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482074#M72645</guid>
      <dc:creator>NominalLogNewt5</dc:creator>
      <dc:date>2022-04-26T07:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple files</title>
      <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482178#M72654</link>
      <description>&lt;P&gt;Only thing that quickly comes to my mind is that you are missing {} around the arguments of function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_and_modify = function(file_path, {Default Local},
	dt = Open(file_path, Worksheets("Table1"), XXX);

	// New operation e.g. New column: Column 2
	dt &amp;lt;&amp;lt; New Column("Column 2", Numeric, "Continuous", Format("Best", 12));
	dt &amp;lt;&amp;lt; Set Name("File1");
	return(dt);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;when it should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_and_modify = function({file_path}, {Default Local},
	dt = Open(file_path, Worksheets("Table1"), XXX);

	// New operation e.g. New column: Column 2
	dt &amp;lt;&amp;lt; New Column("Column 2", Numeric, "Continuous", Format("Best", 12));
	dt &amp;lt;&amp;lt; Set Name("File1");
	return(dt);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 14:04:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482178#M72654</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-26T14:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple files</title>
      <link>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482301#M72664</link>
      <description>&lt;P&gt;Possibly an issue with an international keyboard using the curly braces to make locale-specific characters?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/2388805/brackets-and-international-keyboards" target="_blank"&gt;https://stackoverflow.com/questions/2388805/brackets-and-international-keyboards&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://superuser.com/questions/1486481/when-i-press-the-curly-braces-key-on-the-keyboard-i-get-a-backtick-instead" target="_blank"&gt;https://superuser.com/questions/1486481/when-i-press-the-curly-braces-key-on-the-keyboard-i-get-a-backtick-instead&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.reddit.com/r/Anki/comments/j1c5o2/curly_braces_dont_work_with_norwegian_keyboard/" target="_blank"&gt;https://www.reddit.com/r/Anki/comments/j1c5o2/curly_braces_dont_work_with_norwegian_keyboard/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://cs50.stackexchange.com/questions/9603/curly-brackets-on-my-keyboard" target="_blank"&gt;https://cs50.stackexchange.com/questions/9603/curly-brackets-on-my-keyboard&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://discussions.apple.com/thread/7418604" target="_blank"&gt;https://discussions.apple.com/thread/7418604&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 15:38:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Importing-multiple-files/m-p/482301#M72664</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-04-26T15:38:45Z</dc:date>
    </item>
  </channel>
</rss>

