<?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: Accepting data in form of column, converting to string in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660519#M84950</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/48856"&gt;@aidanweb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;It sounds like you're set on how to parse the entry, but that the display of the entry is giving you issues. It may seem like the text edit box is only taking in one line when in fact all the lines are pasting just fine, but the height of the box isn't allowing you to see them (if you arrow up and down in the edit box you'll see the other lines).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would do is pre-size the edit box when making the dialog to roughly the expected size of the paste. You can do that by adding something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;b1&amp;lt;&amp;lt;SetNLines(10)&amp;lt;&amp;lt;set width(150);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="julian_1-1689855037582.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55022i6EE964CF255AEE0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="julian_1-1689855037582.png" alt="julian_1-1689855037582.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Lots = "abc";

w = New Window("Lot(s) of Interest",
	Border Box(top(50), bottom(50), Left(50), Right(50),
		V List Box(
			H Center Box(Text Box("Lot(s) of Interest Input")),
			Spacer Box(size(1, 30)),
			H List Box(Text Box("Lots: "), b1 = Text Edit Box(Lots)),
			Spacer Box(size(1, 10)),
			H Center Box(
				Button Box("Save",
					Lots = b1 &amp;lt;&amp;lt; get text;
					w &amp;lt;&amp;lt; closeWindow; 
				)
			)
		)
	)
);
b1&amp;lt;&amp;lt;SetNLines(10)&amp;lt;&amp;lt;set width(150);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 12:11:01 GMT</pubDate>
    <dc:creator>jules</dc:creator>
    <dc:date>2023-07-20T12:11:01Z</dc:date>
    <item>
      <title>Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660390#M84940</link>
      <description>&lt;P&gt;I'm trying to do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accept this input from user:&amp;nbsp;&lt;/P&gt;&lt;P&gt;A1234965&lt;BR /&gt;A1233339&lt;BR /&gt;A1234736&lt;BR /&gt;A123494Z&lt;BR /&gt;A1233114&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Convert it to the string: "A1234965,A1233339,A1234736,A123494Z,A1233114"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With no limit on how long the inputted "column" is. I want the user to paste the "column" into a popup window that asks for it, then store that data as the string above. My real problem is finding a way to accept that input from the user ("text edit box" won't let a column-format be pasted). Then, of course, I don't know how to convert that input into the string format I need. Any help would be appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 23:24:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660390#M84940</guid>
      <dc:creator>aidanweb</dc:creator>
      <dc:date>2023-07-19T23:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660397#M84941</link>
      <description>&lt;P&gt;Use the Concat Items() function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

x={"aa","bb"};

y=concat items(x,",");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jul 2023 00:40:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660397#M84941</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-07-20T00:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660406#M84943</link>
      <description>&lt;P&gt;Thank you, I'll definitely be using the concat function. My big problem is taking in the user input. They'd be copying a column from a datatable and pasting it into an edit box. In my current code (seen below), it'll only take the first cell of the copied column... I'm assuming this is because I'm using a "Text Edit Box" and the Text data type - is there an edit box and data type that could take data formatted like this?:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A1234965&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A1233339&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A1234736&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A123494Z&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A1233114&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my current code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Lots = "abc";

w = New Window("Lot(s) of Interest",
	Border Box(top(50), bottom(50), Left(50), Right(50),
		V List Box(
			H Center Box(Text Box("Lot(s) of Interest Input")),
			Spacer Box(size(1, 30)),
			H List Box(Text Box("Lots: "), b1 = Text Edit Box(Lots)),
			Spacer Box(size(1, 10)),
			H Center Box(
				Button Box("Save",
					Lots = b1 &amp;lt;&amp;lt; get text;
					w &amp;lt;&amp;lt; closeWindow;&amp;nbsp;
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jul 2023 04:58:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660406#M84943</guid>
      <dc:creator>aidanweb</dc:creator>
      <dc:date>2023-07-20T04:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660417#M84944</link>
      <description>&lt;P&gt;You will have to split the data first using &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/list-functions.shtml?os=win&amp;amp;source=application#ww2491421" target="_blank" rel="noopener"&gt;Words()&lt;/A&gt; before using Concat Items(). Depending where the data is being pasted from, sometimes you might have to perform some substitutions before using Words(). These can be done with &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/character-functions-2.shtml?os=win&amp;amp;source=application#ww4813286" target="_blank" rel="noopener"&gt;Regex() using GLOBALREPLACE&lt;/A&gt; or &lt;A href="https://help.jmp.com/help?keyword=JSL%20Substitute&amp;amp;lang=en&amp;amp;os=win&amp;amp;source=application&amp;amp;version=16.2.0" target="_blank" rel="noopener"&gt;Substitute()/Substitute Into()&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also might be good idea to remove duplicates (Associative Arrays can be used for this, if it doesn't matter that they will be ordered alphabetically).&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 04:57:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660417#M84944</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-20T04:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660519#M84950</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/48856"&gt;@aidanweb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;It sounds like you're set on how to parse the entry, but that the display of the entry is giving you issues. It may seem like the text edit box is only taking in one line when in fact all the lines are pasting just fine, but the height of the box isn't allowing you to see them (if you arrow up and down in the edit box you'll see the other lines).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would do is pre-size the edit box when making the dialog to roughly the expected size of the paste. You can do that by adding something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;b1&amp;lt;&amp;lt;SetNLines(10)&amp;lt;&amp;lt;set width(150);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="julian_1-1689855037582.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55022i6EE964CF255AEE0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="julian_1-1689855037582.png" alt="julian_1-1689855037582.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Lots = "abc";

w = New Window("Lot(s) of Interest",
	Border Box(top(50), bottom(50), Left(50), Right(50),
		V List Box(
			H Center Box(Text Box("Lot(s) of Interest Input")),
			Spacer Box(size(1, 30)),
			H List Box(Text Box("Lots: "), b1 = Text Edit Box(Lots)),
			Spacer Box(size(1, 10)),
			H Center Box(
				Button Box("Save",
					Lots = b1 &amp;lt;&amp;lt; get text;
					w &amp;lt;&amp;lt; closeWindow; 
				)
			)
		)
	)
);
b1&amp;lt;&amp;lt;SetNLines(10)&amp;lt;&amp;lt;set width(150);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 12:11:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660519#M84950</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2023-07-20T12:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660607#M84957</link>
      <description>&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>Thu, 20 Jul 2023 14:46:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660607#M84957</guid>
      <dc:creator>aidanweb</dc:creator>
      <dc:date>2023-07-20T14:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660608#M84958</link>
      <description>&lt;P&gt;Like I said earlier, use Words() to split it into a list. Then use Concat Items() to combine that list back to a string. It might be enough to use \!N as separator with Words() but sometimes it might not work correctly&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

str = "abc
def";

lst = Words(str, "\!N");

str2 = "'" || Concat Items(lst, "','") || "'";

show(str, lst, str2);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;As this can be fairly common task to do with JSL below is complete example. This example does contain some a bit more advanced techniques which can be used when building user-interfaces with JSL, so it is a good idea to start with the example &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt; provided first.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

lotquery = ""; // initialize as empty

initial_input = "A1234965
A1233339
A1234736
A123494Z
A1233114
A1233114";

nw = New Window("Lot(s) of Interest", Show Toolbars(0), Show Menu(0),// &amp;lt;&amp;lt; modal,
	Border Box(top(10), bottom(5), Left(20), Right(20),
		V List Box(align("center"),
			Text Box("Input lots of interest:"),
			Text Edit Box(initial_input, &amp;lt;&amp;lt; Set NLines(10), &amp;lt;&amp;lt; set width(250)), // &amp;lt;&amp;lt; Set Text Changed or &amp;lt;&amp;lt; Set Function can be used for cleanup during input
			Spacer Box(size(300, 10)), // Use wide spacer box to easily force window width
			Panel Box("Actions",
				Lineup Box(N Col(2),
					Button Box("OK", 
						&amp;lt;&amp;lt; Set Function(function({this},
							Local({input_values, input_list},
								input_values = (this &amp;lt;&amp;lt; top parent)[Text Edit Box(1)] &amp;lt;&amp;lt; get text;
								If(IsMissing(input_values), // very lazy check
									Throw("No lots provided!");
								);
								input_list = Associative Array(Words(input_values, "\!N")) &amp;lt;&amp;lt; get keys; // aa to remove duplicates
								lotquery = "'" || Concat Items(input_list, "', '") || "'";
							);
							write("Input lots: " || lotquery);
							(this &amp;lt;&amp;lt; top parent) &amp;lt;&amp;lt; Close Window;
						));
					),
					Button Box("Close", 
						&amp;lt;&amp;lt; Set Function(function({this}, 
							(this &amp;lt;&amp;lt; top parent) &amp;lt;&amp;lt; Close Window;
						))
					)
				)
			)
		)
	),
	&amp;lt;&amp;lt; Set Window Icon("WebBrowserImportAsData")
);

/* // if modal is used
If(nw["Button"] != 1,
	Throw("Cancel pressed");
);

If(IsMissing(lotquery),
	Throw("No lots provided!");
);
*/
Write();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1689866153494.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55031iA263EFABCCEB08BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1689866153494.png" alt="jthi_0-1689866153494.png" /&gt;&lt;/span&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 20 Jul 2023 15:16:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660608#M84958</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-20T15:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660621#M84960</link>
      <description>&lt;P&gt;Thank you, this helps tons. I'm still having an issue converting the input into a list, formatted like so: {"aa", "bb", "cc"}. I would've thought the words function would work right away, as the input is just a long string.... but I'm probably doing something wrong. I attached a screenshot of my log.&amp;nbsp;&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="aidanweb_0-1689866223428.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55032i9EB1C53B94CE2AA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aidanweb_0-1689866223428.png" alt="aidanweb_0-1689866223428.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 15:17:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660621#M84960</guid>
      <dc:creator>aidanweb</dc:creator>
      <dc:date>2023-07-20T15:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting data in form of column, converting to string</title>
      <link>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660639#M84961</link>
      <description>&lt;P&gt;You missed including the appropriate delimiter in the &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/list-functions.shtml#ww2491421" target="_self"&gt;Words()&lt;/A&gt; function. In your case you want an end of line character (or characters) as the delimiter. See the table of Escape Sequences for Quoted Strings in the &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/jsl-syntax-rules.shtml" target="_self"&gt;JSL syntax rules&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Lots = "abc";
w = New Window( "Lot (s) of Interest",
	Border Box( top( 50 ), bottom( 50 ), Left( 50 ), Right( 50 ),
		V List Box(
			H Center Box( Text Box( "Lot (s) of Interest Input" ) ),
			Spacer Box( size( 1, 30 ) ),
			H List Box( Text Box( ("Lots: ") ), b1 = Text Edit Box( Lots, &amp;lt;&amp;lt;SetNLines( 10 ), &amp;lt;&amp;lt;set width( 150 ) ) ),
			Spacer Box( size( 1, 10 ) ),
			H Center Box(
				Button Box( "Save",
					Lots = b1 &amp;lt;&amp;lt; get text;
					W &amp;lt;&amp;lt; close window;&lt;BR /&gt;					//include the delimiters for carriage and new line in the Words() function
					newlots = Words( Lots, "\!r\!n" );
					Show( Lots );
					Show( newlots );
				)
			)
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 16:15:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Accepting-data-in-form-of-column-converting-to-string/m-p/660639#M84961</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2023-07-20T16:15:26Z</dc:date>
    </item>
  </channel>
</rss>

