<?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 delete a cell in jsl in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106627#M39044</link>
    <description>&lt;P&gt;Thank you! It worked great! This piece is crucial to the thing that I'm currently working on, and this is really a big help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 15:59:38 GMT</pubDate>
    <dc:creator>emmablue</dc:creator>
    <dc:date>2019-01-16T15:59:38Z</dc:date>
    <item>
      <title>How to delete a cell in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106511#M39014</link>
      <description>&lt;P&gt;I wanted to import a txt file into JMP, but the text is not perfectly aligned. So I want to delete the empty cells. I tried many different ways, but it seems that JMP can only delete an entire column/row. Is there a way to get from the Input to the Output format? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Input:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Column1&lt;/TD&gt;&lt;TD&gt;Column2&lt;/TD&gt;&lt;TD&gt;Column3&lt;/TD&gt;&lt;TD&gt;Column4&lt;/TD&gt;&lt;TD&gt;Column5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Emma&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;38&lt;/TD&gt;&lt;TD&gt;33208&lt;/TD&gt;&lt;TD&gt;30630&lt;/TD&gt;&lt;TD&gt;31360&lt;/TD&gt;&lt;/TR&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&gt;30630&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31360&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;30350&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;48263&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;44694&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;45753&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;47263&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Lisa&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;45961&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;42755&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;43766&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;43887&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;David&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;32799&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;30643&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31365&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;31452&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:22:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106511#M39014</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2019-01-15T19:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a cell in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106514#M39016</link>
      <description>&lt;P&gt;This could be done in various ways using JSL, however, assuming you want to do this interactively, here is how I would do it&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Go to &amp;nbsp; &amp;nbsp; Tables==&amp;gt;Stack and stack columns 1 - 5 into a new data table&lt;/LI&gt;
&lt;LI&gt;In the new table, right click on one of the missing cells, and select, "Select Matching Cells".&lt;/LI&gt;
&lt;LI&gt;Delete the rows that have the missing values&lt;/LI&gt;
&lt;LI&gt;Create a new column, calling it "Column" and specify in the Column Info for the column to Initialize Data to "Sequence Data" with From value of 1 and To value of&amp;nbsp;5 (The number of columns that were stacked) and the Step value to 4 (the number of rows in the original data table)&lt;/LI&gt;
&lt;LI&gt;Now go to &amp;nbsp; &amp;nbsp; Tables==&amp;gt;Split &amp;nbsp; &amp;nbsp; and select the column named "Column" as the Split By selection, and the column named "Data" as the Split Column.&lt;/LI&gt;
&lt;LI&gt;The resulting new data table should allow you to either&amp;nbsp; do a &amp;nbsp; &amp;nbsp; Tables==&amp;gt;Update &amp;nbsp;&amp;nbsp; or just a Cut and Paste to copy the new results back to the original data table&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 15 Jan 2019 19:47:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106514#M39016</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-15T19:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a cell in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106596#M39034</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7142"&gt;@emmablue&lt;/a&gt;, Jim provided a solution of how to fix the problem once the text file is imported. I will explain two options, each depends upon your original file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#1 If your original file has spaces as the column delimiters, the fix could be easy. When you select &lt;STRONG&gt;File &amp;gt;Open&lt;/STRONG&gt; use the option &lt;STRONG&gt;Data with Preview&lt;/STRONG&gt; and make sure both Space and Spaces are selected&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 607px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15124i7DD20EFBE51A5527/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 661px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/15125i9723EB0242A3DC7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you had selected &lt;STRONG&gt;Data, using Text Import Preferences&lt;/STRONG&gt;, your default could be Space. If that is the case, the fix via the UI is use &lt;STRONG&gt;Data with Preview&lt;/STRONG&gt;. If you are using a script, the Open statement in the script below should be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#2&amp;nbsp;&lt;SPAN&gt;If your original file has tabs as the column delimiters, the fix is not as easy. Via the UI you can use a text editor and use find an replace a tab with spaces.&amp;nbsp; I found no method to specify Tabs in case there are extra tabs. &lt;FONT color="#0000FF"&gt;Comment: a &lt;STRONG&gt;Tabs&lt;/STRONG&gt; option might be a good wish list item, or allow the user to specify more than one character such as 0x090x09 or&amp;nbsp; HexToChar("0909") for &lt;STRONG&gt;Other&lt;/STRONG&gt; or add an option to &lt;STRONG&gt;Ignore repeated delimiters&lt;/STRONG&gt;.&lt;FONT color="#000000"&gt; If you cannot edit the file, or do not want to use the text editor to replace each tab with a space, and if you are using a Windows PC, you can modify the JSL file below by changing the file paths. If your Name column has spaces this will not work and a different script using regular expressions can be used to replace duplicate tabs with a single tab.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;If you copy and pasted&amp;nbsp; the data into the table, then you should use Jim's solution.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;If you have more details about the input file, a more useful script/solution can be provided.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

findchar = "\!t"; //tab
infid    = "C:\temp\ExtraTab_testIn.txt"; //file path
outfid   = "c:\temp\_xxxdummy.txt";

//This was DOS script was found at StackOverflow 1/16/2019
//https://stackoverflow.com/questions/23075953/batch-script-to-find-and-replace-a-string-in-text-file-without-creating-an-extra/23076141
//It replaces the tabs in the infid with spaces and writes it to a outfid with spaces.
//If you want to replace the original file's tabs do the following
//    uncomment lines 29 and 30 below: "del %textfile"" and "rename %newfile %textfile"
//    change the Open( outfid, ..) to Open(infid, ...) in line 38
//To keep outfid, don't make the changes described above. But comment or delete the last JSL statement

dos_cmds = {
"cd c:\temp",
"@echo off &amp;amp;setlocal",
EvalInsert("set \!"search=%^findchar^\!""),
"set \!"replace=% \!"",
EvalInsert("set \!"textfile=^infid^\!""),
EvalInsert("set \!"newfile=^outfid^\!""),
"(for /f \!"delims=\!" %%i in (%textfile%) do (",
"   set \!"line=%%i\!"",
"    setlocal enabledelayedexpansion",
"    set \!"line=!line:%search%=%replace%!\!"",
"    echo(!line!",
"    endlocal",
"))&amp;gt;\!"%newfile%\!""
// , "del %textfile%",
// "rename %newfile%  %textfile%"
};
txt = concat items(EvalList(dos_cmds), "\!N");

f = Save Text File("c:\temp\Find_Replace.bat", txt, Mode("replace"));

Web("c:\temp\Find_Replace.bat"); //simple command to execute a .bat

dt = Open( outfid,
	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( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

If( File Exists(outfid), Delete File(outfid) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 09:38:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106596#M39034</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-01-16T09:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a cell in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106602#M39036</link>
      <description>&lt;P&gt;If your file is not extremely large and your version of JMP includes the character function Collapse Whitespace();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a simpler solution using JSL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

infid  = "c:\temp\ExtraTab_testIn.txt";
outfid = "c:\temp\_xxxdummy.txt";

fid = Load Text File(infid);
ww = words(fid, "\!N");  //each line is stored  as text in a list
for(i=1, i&amp;lt;=nitems(ww), i++,
	ww[i] = Collapse Whitespace(ww[i]);  //replace tabs spaces, or any nonprinatble char even EOL with a single space
);
fid = Concat Items(ww, "\!N");  //combine into a single text and add the EOL char
Save Text File(outfid,fid);     //save it
&lt;BR /&gt;delete symbols(fid, ww);

//open it
dt = Open( outfid,
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( 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( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

If( File Exists(outfid), Delete File(outfid) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jan 2019 10:33:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106602#M39036</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-01-16T10:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a cell in jsl</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106627#M39044</link>
      <description>&lt;P&gt;Thank you! It worked great! This piece is crucial to the thing that I'm currently working on, and this is really a big help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 15:59:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-delete-a-cell-in-jsl/m-p/106627#M39044</guid>
      <dc:creator>emmablue</dc:creator>
      <dc:date>2019-01-16T15:59:38Z</dc:date>
    </item>
  </channel>
</rss>

