<?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 line up each field? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777143#M95832</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	For Each( {col},
		dt &amp;lt;&amp;lt; Get Column Reference( dt &amp;lt;&amp;lt; Get Column Names( Character ) ),
		If( !Is Empty( col &amp;lt;&amp;lt; Get Formula ),
			Continue()
		);
		For Each Row( dt, col[] = Substitute( col[], ",", " ", &amp;lt;&amp;lt;IGNORECASE ) );
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I replace that line with these code. It's working now. Thanks.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jul 2024 23:29:01 GMT</pubDate>
    <dc:creator>Victor3</dc:creator>
    <dc:date>2024-07-28T23:29:01Z</dc:date>
    <item>
      <title>How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777128#M95829</link>
      <description>&lt;P&gt;I have txt file. I would like to import to JMP to analysis. But some columns are not line up. How do I line up them?&lt;/P&gt;&lt;P&gt;The delimited should be space, spaces and comma. But ", " will treat space as text. How do I overcome this problem?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="how to line up each field.jpg" style="width: 951px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66566i2060C93EF89DABA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="how to line up each field.jpg" alt="how to line up each field.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTlog = Open(
	D,
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Spaces, Space, CSV( 1 ), Comma ),
		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 ),
		Data Starts( 2 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 20:02:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777128#M95829</guid>
      <dc:creator>Victor3</dc:creator>
      <dc:date>2024-07-28T20:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777139#M95830</link>
      <description>&lt;P&gt;The issue you are having is that you are using spaces and commas for delimiters, and in column f you have rows that have both a comma and a space delimiter side by side.&amp;nbsp; An example is&lt;/P&gt;
&lt;PRE&gt;4, 7&lt;/PRE&gt;
&lt;P&gt;The column C1c reads in the 4, it then sees the , as a delimiter followed by a space as a second delimiter so since it did not see a value after the first delimiter and the second delimiter, it applies a missing value to the column f, and the 7 then becomes the value for the column C2c.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a script that reads in all of the data, removes all commas, saves it to a temp area and then reads it back in using your input stream&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
d= "&amp;lt;your path and file name&amp;gt;";
dt = Open(
   D	,
	columns( New Column( "c000001", Character, "Nominal" ) ),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( CSV( 0 ) ),
		Treat Leading Zeros as Character( 1 ),
		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( 0 ),
		First Named Column( 0 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

for each row(:c000001 = Trim(substitute(:c000001,","," ")));

dt &amp;lt;&amp;lt; save ("$TEMP\interium file.txt");

dtTlog = Open(
	"$TEMP\interium file.txt",
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Spaces, Space, CSV( 1 ), Comma ),
		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 ),
		Data Starts( 3 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1722201691498.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66567iC5C89FFC116A67C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1722201691498.png" alt="txnelson_0-1722201691498.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 11:35:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777139#M95830</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-07-29T11:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777142#M95831</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMP Alert01.jpg" style="width: 429px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66568i7EC05C40867B5FF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="JMP Alert01.jpg" alt="JMP Alert01.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Okay, I see. I understand your suggestion. But it give me above alert.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 23:11:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777142#M95831</guid>
      <dc:creator>Victor3</dc:creator>
      <dc:date>2024-07-28T23:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777143#M95832</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	For Each( {col},
		dt &amp;lt;&amp;lt; Get Column Reference( dt &amp;lt;&amp;lt; Get Column Names( Character ) ),
		If( !Is Empty( col &amp;lt;&amp;lt; Get Formula ),
			Continue()
		);
		For Each Row( dt, col[] = Substitute( col[], ",", " ", &amp;lt;&amp;lt;IGNORECASE ) );
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I replace that line with these code. It's working now. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 23:29:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777143#M95832</guid>
      <dc:creator>Victor3</dc:creator>
      <dc:date>2024-07-28T23:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777144#M95833</link>
      <description>&lt;P&gt;I had a slight error in my original code.&amp;nbsp; I have gone back and corrected it.&amp;nbsp; Please copy it and verify that it works.&amp;nbsp; The fix you put in place was good, however, the original code does not read in each column separately.&amp;nbsp; It reads in all of the data in each row as one column, and then deals with it from the standpoint of having a data table with just one column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 00:59:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777144#M95833</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-07-29T00:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777170#M95837</link>
      <description>&lt;P&gt;Alternatively, one could use &lt;FONT face="courier new,courier"&gt;Load Text File&amp;nbsp;&lt;/FONT&gt;to open the file as text, remove the commas via &lt;FONT face="courier new,courier"&gt;substitute&lt;/FONT&gt; and finally &lt;FONT face="courier new,courier"&gt;Open&lt;/FONT&gt;&amp;nbsp;the text into a data table&lt;BR /&gt;&lt;BR /&gt;original posts:&lt;BR /&gt;&lt;LI-MESSAGE title=".csv Import error" uid="210192" url="https://community.jmp.com/t5/Discussions/csv-Import-error/m-p/210192#U210192" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; /&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;LI-MESSAGE title="File Import: specify NAN?" uid="707010" url="https://community.jmp.com/t5/Discussions/File-Import-specify-NAN/m-p/707010#U707010" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;txtfile = Load Text File("$DOWNLOADS/log - question2.txt");
substituteinto(txtfile,","," ");
Open(
	Char to Blob(txtfile),
	Import Settings(
		End Of Field( Spaces, Space ),
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 09:05:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777170#M95837</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-07-29T09:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to line up each field?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777183#M95839</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Text To Columns: handle missing data correctly" uid="582008" url="https://community.jmp.com/t5/JMP-Wish-List/Text-To-Columns-handle-missing-data-correctly/m-p/582008#U582008" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;BR /&gt;&lt;EM&gt;"correctly"?&lt;/EM&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for &lt;U&gt;your&lt;/U&gt; task, text To Columns works like a charm:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
	"$DOWNLOADS/log - question2.txt",
	Import Settings(
		End Of Field( Tab ),
		Labels( 0 )
	)
);

// split columns via Text to columns
dt  &amp;lt;&amp;lt; Text to Columns(	columns( :c000001 ),	Delimiters( " ", "," ));
dt &amp;lt;&amp;lt; Delete Columns( :c000001);

// Move column names up
dt &amp;lt;&amp;lt; Move up;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 15:14:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-line-up-each-field/m-p/777183#M95839</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-07-29T15:14:38Z</dc:date>
    </item>
  </channel>
</rss>

