<?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 How to export column data to string or txt in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/766095#M94602</link>
    <description>&lt;P&gt;I have the following data table, how can I export the column using JSL:&lt;/P&gt;&lt;P&gt;1. string = 561193, 542003, 527679...&lt;/P&gt;&lt;P&gt;2. export the data to .txt where the values show:&amp;nbsp;561193, 542003, 527679...&lt;/P&gt;&lt;P&gt;s&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReliabilityWolf_0-1718419312549.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65237iA4A709945DAFACD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReliabilityWolf_0-1718419312549.png" alt="ReliabilityWolf_0-1718419312549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jun 2024 02:48:09 GMT</pubDate>
    <dc:creator>ReliabilityWolf</dc:creator>
    <dc:date>2024-06-15T02:48:09Z</dc:date>
    <item>
      <title>How to export column data to string or txt</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/766095#M94602</link>
      <description>&lt;P&gt;I have the following data table, how can I export the column using JSL:&lt;/P&gt;&lt;P&gt;1. string = 561193, 542003, 527679...&lt;/P&gt;&lt;P&gt;2. export the data to .txt where the values show:&amp;nbsp;561193, 542003, 527679...&lt;/P&gt;&lt;P&gt;s&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReliabilityWolf_0-1718419312549.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65237iA4A709945DAFACD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ReliabilityWolf_0-1718419312549.png" alt="ReliabilityWolf_0-1718419312549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 02:48:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/766095#M94602</guid>
      <dc:creator>ReliabilityWolf</dc:creator>
      <dc:date>2024-06-15T02:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to export column data to string or txt</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/766105#M94603</link>
      <description>&lt;P&gt;Here is one way to do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// Create an example data table
dt = New Table( "Example",
	add rows( 100 ),
	New Column( "Number", character, set each value( Char( Random Integer( 1000, 9999 ) ) ) )
);

// Convert character column to a literal string value
string = Concat Items( dt:number[Index( 1, N Rows( dt ) )], "," );

// Write the string variable to a .txt file
Save Text File( "$TEMP/savedfile.txt", string );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Jun 2024 03:57:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/766105#M94603</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-15T03:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to export column data to string or txt</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768442#M94870</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,thank you very much for reply. it really works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am new JSLer. I have to seek for your help here: How can I use the selected column to replace "dt:number"&amp;nbsp; in following JSL?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table( );
// Stop the script if no open data tables
If( Is Empty( dt ), Stop());
// Make list of column names
colNames = dt &amp;lt;&amp;lt; get column names();
// Select the column
nw = New Window("Column names", &amp;lt;&amp;lt;Modal,
PanelBox("Pick a column",
dtlb = ListBox(colNames, MaxSelected(1), columnSelected = (dtlb &amp;lt;&amp;lt; get selected)[1] )
),
H List Box( ButtonBox("OK"), button box("Cancel"); )
);
If( nw["button"] == -1, throw() );
// Convert character column to a literal string value
inString = "'" || Concat Items( dt:number[Index( 1, N Rows( dt ) )], "','" ) || "'";&lt;/CODE&gt;&lt;/PRE&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;</description>
      <pubDate>Wed, 26 Jun 2024 05:49:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768442#M94870</guid>
      <dc:creator>ReliabilityWolf</dc:creator>
      <dc:date>2024-06-26T05:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to export column data to string or txt</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768564#M94880</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table( );
// Stop the script if no open data tables
If( Is Empty( dt ), Stop());
// Make list of column names
colNames = dt &amp;lt;&amp;lt; get column names();
// Select the column
nw = New Window("Column names", &amp;lt;&amp;lt;Modal,
PanelBox("Pick a column",
dtlb = ListBox(colNames, MaxSelected(1), columnSelected = (dtlb &amp;lt;&amp;lt; get selected)[1] )
),
H List Box( ButtonBox("OK"), button box("Cancel"); )
);
If( nw["button"] == -1, throw() );
// Convert character column to a literal string value
inString = "'" || Concat Items( column(columnSelected)&amp;lt;&amp;lt;get values, "','" ) || "'";

// The above will work only if the column selected is a character column
// I suggest that you change your "&amp;lt;&amp;lt; get column names()"  to
// "&amp;lt;&amp;lt; get column names(character)"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jun 2024 10:06:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768564#M94880</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-26T10:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to export column data to string or txt</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768611#M94887</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 13:38:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-export-column-data-to-string-or-txt/m-p/768611#M94887</guid>
      <dc:creator>ReliabilityWolf</dc:creator>
      <dc:date>2024-06-26T13:38:47Z</dc:date>
    </item>
  </channel>
</rss>

