<?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 multiple CSV files, but some title format error need to modify by JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711113#M89472</link>
    <description>&lt;P&gt;&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;Your solution is awesome!&lt;/P&gt;
&lt;P&gt;One question.&amp;nbsp; Your line where you are removing the parentheses from each line, you specify&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where you substitute all "(" to ")" and then substitute all ")" to "".&lt;/P&gt;
&lt;P&gt;My old school approach would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Collapse Whitespace(Substitute(line, "(", "", ")", ""))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where the "(" are substituted with "" and then the ")" are substituted to "".&lt;/P&gt;
&lt;P&gt;Is there an advantage to your syntax or is it just a personal choice?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2023 14:12:06 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-12-20T14:12:06Z</dc:date>
    <item>
      <title>Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/710961#M89463</link>
      <description>&lt;P&gt;I'm trying to import multiple CSV files, the "import multiple files" function doesn't work well because original data column name format has two problems that will cause title and data don't match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The data column name looks like this:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Date time name ( A B C ) (D E F ) height weight ......etc&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The dilim I need are space and ( and )&lt;/P&gt;&lt;P&gt;3. However, there is additional space or tab before "Date", so the first column name becomes Column 1 rather than Date, and title right shift one column compare to data&lt;/P&gt;&lt;P&gt;4. second error is (D, there in no space between this two for the title, so they are treated as one title, but the data are separated into ( and D two columns because there is space in between, so title will left shift one column compare to data&lt;/P&gt;&lt;P&gt;5. The first error always exist before first column name "Date", but the second error "(D" may appear at different order based on source tool&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to wirte a JSL so that it can automatically match all title and columns, but not sure how to do this:&lt;/P&gt;&lt;P&gt;I guess the first step is to use&amp;nbsp;&amp;nbsp;Get Column Names() then parse the names, but parse() and word() seems don't work.&lt;/P&gt;&lt;P&gt;I' m stucked here, really raw at coding, thank you for your help in advance&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="sample data.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59913i4C323B4AC74B4D03/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample data.png" alt="sample data.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 08:12:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/710961#M89463</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-20T08:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/710993#M89465</link>
      <description>&lt;P&gt;If it is possible to provide one example (or few if there are different kinds of) .csv file it would make this easier. If not, could you provide one "broken" data table?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 07:18:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/710993#M89465</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-20T07:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711013#M89467</link>
      <description>&lt;P&gt;I attached sample table for your reference&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 07:40:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711013#M89467</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-20T07:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711051#M89470</link>
      <description>&lt;P&gt;Based on the two line example I would most likely go by cleaning the .csv file (remove () and collapse whitespaces) and then use Open with Char to Blob() to convert that "fixed" string into a data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = Load Text File("$DOWNLOADS/sample CSV.csv");

lines = Words(str, "\!N");

data = Transform Each({line}, lines, 
	str = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))	
);

str = Concat Items(data, "\!N");

dt = Open(Char To Blob(str),
	Import Settings(
		End Of Line(CRLF, CR, LF),
		End Of Field(Spaces, Space, 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),
		First Named Column(1),
		Data Starts(2),
		Lines To Read("All"),
		Year Rule("20xx")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Dec 2023 10:26:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711051#M89470</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-20T10:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711113#M89472</link>
      <description>&lt;P&gt;&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;Your solution is awesome!&lt;/P&gt;
&lt;P&gt;One question.&amp;nbsp; Your line where you are removing the parentheses from each line, you specify&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where you substitute all "(" to ")" and then substitute all ")" to "".&lt;/P&gt;
&lt;P&gt;My old school approach would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Collapse Whitespace(Substitute(line, "(", "", ")", ""))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where the "(" are substituted with "" and then the ")" are substituted to "".&lt;/P&gt;
&lt;P&gt;Is there an advantage to your syntax or is it just a personal choice?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 14:12:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711113#M89472</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-20T14:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711182#M89476</link>
      <description>&lt;P&gt;It is just my personal choice. Generally when I want to replace multiple things with same thing, I provide Substitute a list of the values to replace and then the value once. If I want to replace them with different things I use the approach you did show OR if I have to build it dynamically/have configuration file I will use two lists&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "AA BB CC DD";

a = Substitute(str, {"AA", "BB"}, "11"); // a = "11 11 CC DD";
b = Substitute(str, "AA", "11", "BB", "22"); // b = "11 22 CC DD";

subs = ["AA" =&amp;gt; "33", "BB" =&amp;gt; "44"];
c = Substitute(str, subs &amp;lt;&amp;lt; get keys, subs &amp;lt;&amp;lt; Get Values); // c = "33 44 CC DD";

show(a, b, c);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Dec 2023 14:53:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711182#M89476</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-20T14:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711217#M89480</link>
      <description>&lt;P&gt;Thank you for your support, this method works well for single file&lt;/P&gt;&lt;P&gt;But I still have one question left, I have a lot of&amp;nbsp; files with same format that needs to be imported as one JMP file.&lt;/P&gt;&lt;P&gt;So it seems this method requires me to open them one by one then do cocatenate into one file&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is why my original thought was:&lt;/P&gt;&lt;P&gt;1. use multiple import function&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; get column names&lt;/P&gt;&lt;P&gt;3. then use recode column name function to modify each column name&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 15:39:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711217#M89480</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-20T15:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711231#M89482</link>
      <description>&lt;P&gt;Is there some specific reason why you couldn't do the following&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Get list of files you are interested in&lt;/LI&gt;
&lt;LI&gt;Use For Each to loop over them&lt;/LI&gt;
&lt;LI&gt;Inside the loop parse the files and concatenate them to a table which you open first&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;You could try to also fix the columns but based on your example it was much easier to just fix the csv file than start messing with column names and/or shifting values after importing the values&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 15:52:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711231#M89482</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-20T15:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711318#M89485</link>
      <description>&lt;P&gt;Fixing the program that generates the file might also be a good option. That is not a standard CSV and I don't think any other program is going to parse it correctly either.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 19:07:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711318#M89485</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-12-20T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711418#M89500</link>
      <description>&lt;DIV&gt;I tried to use for loop to loop over files, but it doesn't work, looks like something goes wrong when I tried to concat them&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dir = Pick Directory("Select a directory");
filelist = Files In Directory(dir);
strings = {};
 
For(i = 1, i &amp;lt;= N Items(filelist), i++,
	file = dir || Eval(Parse(filelist[i]));
	str = Load Text File(file);
	lines = Words(str, "\!N");
	data = Transform Each({line}, lines,
		str = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))
	);
	str = Concat Items(data, "\!N");
	strings = strings || str;
);
 
 
 
dt = Open(
	Char To Blob(str),
	Import Settings(
		End Of Line(CRLF, CR, LF),
		End Of Field(Spaces, Space, 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(2),
		First Named Column(1),
		Data Starts(3),
		Lines To Read("All"),
		Year Rule("20xx")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 10:42:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711418#M89500</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-21T10:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711435#M89502</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Concatenate data tables" uid="82457" url="https://community.jmp.com/t5/JSL-Cookbook-Archived/Concatenate-data-tables/m-p/82457#U82457" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; shows one way to do it&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 10:22:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711435#M89502</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-12-21T10:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711528#M89511</link>
      <description>&lt;P&gt;After several trial, below code sucessfully import multiple CSVs through loop, and the format are correct.&lt;/P&gt;&lt;P&gt;But I still have two remain issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. starting from second file, the headers are not exclude as column title, they are treated as data in the table, there are two rows of headers, first row is file name, second row are titles separted by space&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I would like to add filename column so that i can analyze different files, but this is not like import mutiple file function that I can easily achieve it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Names Default To Here( 1 );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dir = Pick Directory( "Select a directory" );&lt;/P&gt;&lt;P&gt;filelist = Files In Directory( dir );&lt;/P&gt;&lt;P&gt;mylist = {};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For( i = 1, i &amp;lt;= N Items( filelist ), i++,&lt;BR /&gt;file = dir || "/" || filelist[i];&lt;BR /&gt;str = Load Text File( file );&lt;BR /&gt;lines = Words(str, "\!N");&lt;BR /&gt;data = Transform Each({line}, lines,&lt;BR /&gt;line = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))&lt;BR /&gt;);&lt;BR /&gt;modifiedstr = Concat Items(data, "\!N");&lt;BR /&gt;mylist[i] = modifiedstr;&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;dt = Open(&lt;BR /&gt;Char To Blob( Concat Items( mylist, "\!N" ) ),&lt;BR /&gt;Import Settings(&lt;BR /&gt;End Of Line( CRLF, CR, LF ),&lt;BR /&gt;End Of Field( Spaces, Space, CSV( 0 ) ),&lt;BR /&gt;Strip Quotes( 1 ),&lt;BR /&gt;Use Apostrophe as Quotation Mark( 0 ),&lt;BR /&gt;Use Regional Settings( 0 ),&lt;BR /&gt;Treat empty columns as numeric( 0 ),&lt;BR /&gt;Compress Numeric Columns( 0 ),&lt;BR /&gt;Compress Character Columns( 0 ),&lt;BR /&gt;Compress Allow List Check( 0 ),&lt;BR /&gt;Labels( 1 ),&lt;BR /&gt;Column Names Start( 2 ),&lt;BR /&gt;First Named Column( 1 ),&lt;BR /&gt;Data Starts( 3 ),&lt;BR /&gt;Lines To Read( "All" ),&lt;BR /&gt;Year Rule( "20xx" )&lt;BR /&gt;)&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 13:46:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711528#M89511</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-21T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711545#M89513</link>
      <description>&lt;P&gt;Don't create one massive string, but rather create data tables one by one and concatenate those as you go. Also when posting JSL scripts please use "Insert JSL Script" &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1703167167340.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60011iD7E6D455B9C94980/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1703167167340.png" alt="jthi_0-1703167167340.png" /&gt;&lt;/span&gt; as it makes it much easier to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dir = "$DOWNLOADS/New Folder (7)";

filelist = Files In Directory(dir);
mylist = {};

dt_collector = Empty();

For(i = 1, i &amp;lt;= N Items(filelist), i++,
	file = dir || "/" || filelist[i];
	str = Load Text File(file);
	lines = Words(str, "\!N");
	data = Transform Each({line}, lines,
		line = Collapse Whitespace(Substitute(line, {"(", ")"}, ""))
	);
	modifiedstr = Concat Items(data, "\!N");

	dt = Open(
		Char To Blob(modifiedstr),
		Import Settings(
			End Of Line(CRLF, CR, LF),
			End Of Field(Spaces, Space, CSV(0)),
			Strip Quotes(1),
			Use Apostrophe as Quotation Mark(0),
			Use Regional Settings(0),
			Treat empty columns as numeric(0),
			Compress Numeric Columns(0),
			Compress Character Columns(0),
			Compress Allow List Check(0),
			Labels(1),
			Column Names Start(1),
			First Named Column(1),
			Data Starts(2),
			Lines To Read("All"),
			Year Rule("20xx")
		),
		invisible
	);
	
	dt &amp;lt;&amp;lt; Set Name(filelist[i]);
	dt &amp;lt;&amp;lt; New Column("Source", Character, Nominal, &amp;lt;&amp;lt; Set Each Value((dt &amp;lt;&amp;lt; get name)));
	
	If(!Is Empty(dt_collector),
		dt_collector &amp;lt;&amp;lt; Concatenate(
			dt,
			Append to first table
		);
		Close(dt, no save);
	,
		dt_collector = dt;
	);
);&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1703167262034.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60013iEF81464ED8426C0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1703167262034.png" alt="jthi_2-1703167262034.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 14:01:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711545#M89513</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-21T14:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711549#M89515</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; is right, but if you want to keep concatenating the strings, you'll need a few changes.&amp;nbsp; &lt;STRONG&gt;This will fail if the concatenation is &amp;gt;2GB characters because that is the longest string JMP can handle.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;idea:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
For( i = 1, i &amp;lt;= N Items( filelist ), i++,
    file = dir || "/" || filelist[i];
    str = Load Text File( file );
    lines = Words(str, "\!N");
    header1 = RemoveFrom(lines, 1); // remove the first line, two times.
    header2 = RemoveFrom(lines, 1); // (removes both header lines.)
    data = Transform Each({line}, lines,
        // prepend the file name to each data line
        filelist[i] || " " || Collapse Whitespace(Substitute(line, {"(", ")"}, ""));
    );
    modifiedstr = Concat Items(data, "\!N");
    mylist[i] = modifiedstr;
);
header2 = "filename" || header2; // add the column name "filename"
insertInto(mylist,header2,1); // check the order of the arguments, the goal
insertInto(mylist,header1,1); // is to push these onto the front of the list
// now do the import...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;untested, but about right. look up InsertInto() and RemoveFrom(); I don't have JMP open at the moment. The idea is to remove (and capture) the first two lines, every time, and after all is captured and stacked, put the first two lines at the front, with the extra column name tacked on. And inside, tack on the filename for every line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 14:24:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711549#M89515</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-12-21T14:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple CSV files, but some title format error need to modify by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711561#M89518</link>
      <description>&lt;P&gt;Thank you for your support, really learned a lot in this jsl project.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 15:46:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Import-multiple-CSV-files-but-some-title-format-error-need-to/m-p/711561#M89518</guid>
      <dc:creator>BayesRabbit7133</dc:creator>
      <dc:date>2023-12-21T15:46:22Z</dc:date>
    </item>
  </channel>
</rss>

