<?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 store Import Settings of Open() function in a separate expression in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477040#M72149</link>
    <description>&lt;P&gt;One option could be wrapping them like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

settings1 = Expr(
	dt = Open(
		filePath,
		Import Settings(
			End Of Line(CRLF, CR, LF),
			End Of Field(Comma, 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(1),
			Column Names Start(1),
			Data Starts(2),
			Lines To Read("All"),
			Year Rule("20xx")
		)
	)
);


settings2 = Expr(
	dt = Open(
		filePath,
		Import Settings(
			End Of Line(CRLF, CR, LF),
			End Of Field(Comma, 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(1),
			Column Names Start(5),
			Data Starts(6),
			Lines To Read("All"),
			Year Rule("20xx")
		)
	)
);

filePath = "somefilehere";
settings1;
settings2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Apr 2022 13:03:27 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-04-07T13:03:27Z</dc:date>
    <item>
      <title>How to store Import Settings of Open() function in a separate expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/476908#M72136</link>
      <description>&lt;P&gt;I need to open CSV files with various settings.&lt;/P&gt;&lt;P&gt;One of the examples is below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
	filePath,
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, 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( 1 ),
		Column Names Start( 18 ),
		Data Starts( 19 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to store these settings that come inside Import Settings() construct as a separate expression and then use it when opening a file.&lt;/P&gt;&lt;P&gt;Something like this (but it doesn't work this way obviously):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;settings1 = Expr(
Import Settings(
&amp;lt;my import settings here&amp;gt;
)
);
settings2 = Expr(
Import Settings(
&amp;lt;some other import settings here&amp;gt;
)
);

if(condition, importSettings = settings1, importSettings = settings2)
dt = Open(
filePath, 
Eval(importSettings)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:56:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/476908#M72136</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T16:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Import Settings of Open() function in a separate expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477040#M72149</link>
      <description>&lt;P&gt;One option could be wrapping them like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

settings1 = Expr(
	dt = Open(
		filePath,
		Import Settings(
			End Of Line(CRLF, CR, LF),
			End Of Field(Comma, 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(1),
			Column Names Start(1),
			Data Starts(2),
			Lines To Read("All"),
			Year Rule("20xx")
		)
	)
);


settings2 = Expr(
	dt = Open(
		filePath,
		Import Settings(
			End Of Line(CRLF, CR, LF),
			End Of Field(Comma, 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(1),
			Column Names Start(5),
			Data Starts(6),
			Lines To Read("All"),
			Year Rule("20xx")
		)
	)
);

filePath = "somefilehere";
settings1;
settings2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Apr 2022 13:03:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477040#M72149</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-07T13:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Import Settings of Open() function in a separate expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477099#M72154</link>
      <description>&lt;P&gt;I guess I will have to spell out Open() function multiple times then. Or try to use Eval Insert()&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 16:40:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477099#M72154</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-04-07T16:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to store Import Settings of Open() function in a separate expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477102#M72155</link>
      <description>&lt;P&gt;You might be able to do something with techniques mentioned here &lt;LI-MESSAGE title="Can you construct this without writing expression as a string?" uid="369323" url="https://community.jmp.com/t5/Discussions/Can-you-construct-this-without-writing-expression-as-a-string/m-p/369323#U369323" 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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

open_expr = Expr(Open(filePath));

settings1 = Expr(
	Import Settings(
		End Of Line(CRLF, CR, LF),
		End Of Field(Comma, 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(1),
		Column Names Start(1),
		Data Starts(2),
		Lines To Read("All"),
		Year Rule("20xx")
	)
);

Insert Into(open_expr, NameExpr(settings1));
Name Expr(open_expr);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 16:54:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-store-Import-Settings-of-Open-function-in-a-separate/m-p/477102#M72155</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-07T16:54:07Z</dc:date>
    </item>
  </channel>
</rss>

