<?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: How to rename column for multiple PDF tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377266#M62716</link>
    <description>&lt;P&gt;I attempted your approach, and continued to get the error. Therefore I changed to the approach that I used in my last entry. However, when I pasted it into the entry, I left a statement out of the code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;insert into( table_lst, dt );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I believe if you use the code below, it will work for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Prepare a directory
tempdir = "C:\folder path";
// Read PDF's
file_lst = Files In Directory( tempdir );
table_lst = {};
For( i = 1, i &amp;lt;= N Items( file_lst ), i++,
	dt = Open(
		tempdir || "/" || file_lst[i],
		PDF Tables(
			Table( table name( file_lst[i] ), add rows( page( 1 ), Rect( 0.4143, 5.3995, 7.5889, 6.6781 ) ) )
		)
	);
	insert into( table_lst, dt );
	Column( table_lst[i], 3 ) &amp;lt;&amp;lt; set name( "Property" );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Apr 2021 13:10:24 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-04-16T13:10:24Z</dc:date>
    <item>
      <title>How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/376976#M62681</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've wrote a script that enables me to extract a table from multiple pdf files. Each table opens and the table name is matched to the file name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've realised the format of the pdfs isn't always consistent and so the header for column 3 can be different. Therefore, I would like to incorporate a function into my script that renames column 3 as "Property" for all the tables. I've tried the Set Name() function but it's not working. Perhaps it's in the wrong place?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Prepare a directory
tempdir = "C:\folder path";
// Read PDF's
file_lst = Files In Directory( tempdir );
table_lst = {};
For( i = 1, i &amp;lt;= N Items( file_lst ), i++,
	Insert Into( table_lst, Open( tempdir || "/" || file_lst[i], 
	PDF Tables(
		Table(
		table name(file_lst[i]),
		add rows( page( 1 ), Rect( 0.4143, 5.3995, 7.5889, 6.6781 ) ),
		column(table_lst[i],3) &amp;lt;&amp;lt; set name("Property")
		)
	)
)
	)
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help on this would be hugely appreciated!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:28:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/376976#M62681</guid>
      <dc:creator>Alicia</dc:creator>
      <dc:date>2023-06-10T23:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377004#M62682</link>
      <description>&lt;P&gt;I believe the below rework of your code will properly rename the column&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Prepare a directory
tempdir = "C:\folder path";
// Read PDF's
file_lst = Files In Directory( tempdir );
table_lst = {};
For( i = 1, i &amp;lt;= N Items( file_lst ), i++,
	dt = Open(
		tempdir || "/" || file_lst[i],
		PDF Tables(
			Table( table name( file_lst[i] ), add rows( page( 1 ), Rect( 0.4143, 5.3995, 7.5889, 6.6781 ) ) )
		)
	);
	Column( table_lst[i], 3 ) &amp;lt;&amp;lt; set name( "Property" );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Apr 2021 10:41:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377004#M62682</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-15T10:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377029#M62686</link>
      <description>&lt;P&gt;Many thanks for your reply&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;. Unfortunately I get the follow JMP alert when I run the script:&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="Alicia_0-1618490964525.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/32111iB8368FA5C4694A1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alicia_0-1618490964525.png" alt="Alicia_0-1618490964525.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 12:49:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377029#M62686</guid>
      <dc:creator>Alicia</dc:creator>
      <dc:date>2021-04-15T12:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377042#M62688</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;Column( table_lst[i], 3 ) &amp;lt;&amp;lt; set name( "Property" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is outside the "for" loop.&lt;/P&gt;&lt;P&gt;If you copy/paste it into the loop, should work.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 13:51:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377042#M62688</guid>
      <dc:creator>guillaumebugnon</dc:creator>
      <dc:date>2021-04-15T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377048#M62689</link>
      <description>&lt;P&gt;Balanced Parantheses are crucial,&lt;/P&gt;&lt;P&gt;I like very much the option "Reformat Script" (--&amp;gt; Edit-Menu, or crtl-m) to test for correct syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 14:40:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377048#M62689</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2021-04-15T14:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377237#M62711</link>
      <description>&lt;P&gt;Many thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've updated my script as below and it works however after all the tables are open the same JMP Alert comes up again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Prepare a directory
tempdir = "C:\filepath;
// Read PDF's
file_lst = Files In Directory( tempdir );
table_lst = {};
For( i = 1, i &amp;lt;= N Items( file_lst ), i++,
	Insert Into(
		table_lst,
		Open(
			tempdir || "/" || file_lst[i],
			PDF Tables( Table( table name( file_lst[i] ), add rows( page( 1 ), Rect( 0.4143, 5.3995, 7.5889, 6.6781 ) ) ) )
		)
	);
	Column( table_lst[i], 3 ) &amp;lt;&amp;lt; set name( "Property" );
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 12:13:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377237#M62711</guid>
      <dc:creator>Alicia</dc:creator>
      <dc:date>2021-04-16T12:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377265#M62715</link>
      <description>&lt;P&gt;The colors already show you that you have not ended the string tempdir by ";&lt;/P&gt;&lt;P&gt;Reformating the script really helps to see this.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:09:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377265#M62715</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2021-04-16T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377266#M62716</link>
      <description>&lt;P&gt;I attempted your approach, and continued to get the error. Therefore I changed to the approach that I used in my last entry. However, when I pasted it into the entry, I left a statement out of the code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;insert into( table_lst, dt );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I believe if you use the code below, it will work for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Prepare a directory
tempdir = "C:\folder path";
// Read PDF's
file_lst = Files In Directory( tempdir );
table_lst = {};
For( i = 1, i &amp;lt;= N Items( file_lst ), i++,
	dt = Open(
		tempdir || "/" || file_lst[i],
		PDF Tables(
			Table( table name( file_lst[i] ), add rows( page( 1 ), Rect( 0.4143, 5.3995, 7.5889, 6.6781 ) ) )
		)
	);
	insert into( table_lst, dt );
	Column( table_lst[i], 3 ) &amp;lt;&amp;lt; set name( "Property" );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:10:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377266#M62716</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-16T13:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename column for multiple PDF tables</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377769#M62758</link>
      <description>&lt;P&gt;Got it working. Really appreciate all the help!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 11:12:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-rename-column-for-multiple-PDF-tables/m-p/377769#M62758</guid>
      <dc:creator>Alicia</dc:creator>
      <dc:date>2021-04-19T11:12:52Z</dc:date>
    </item>
  </channel>
</rss>

