<?xml version="1.0" encoding="utf-8"?>
<Application>
	<AppTitle>Untitled Application</AppTitle>
	<DesignDeviceName>Samsung Galaxy Tab 7</DesignDeviceName>
	<Variables>[mycsv],[myJson]</Variables>
	<VariablesScanned>True</VariablesScanned>
	<PageWidth>1024</PageWidth>
	<PageHeight>600</PageHeight>
	<AutoSizeWidth>False</AutoSizeWidth>
	<AutoSizeHeight>False</AutoSizeHeight>
	<HideScrollbars>False</HideScrollbars>
	<PublishPlatform>WebApp</PublishPlatform>
	<EmptyBuildFolder>False</EmptyBuildFolder>
	<LanguageCode>en</LanguageCode>
	<MobileOSTypes>[AndroidOS,iOS,WindowsPhoneOS]</MobileOSTypes>
	<WindowState>normal</WindowState>
	<TitleBar>True</TitleBar>
	<Sizeable>True</Sizeable>
	<MaximizeBtn>False</MaximizeBtn>
	<MinimizeBtn>True</MinimizeBtn>
	<SystemMenu>True</SystemMenu>
	<ContextMenu>False</ContextMenu>
	<AlwaysOnTop>False</AlwaysOnTop>
	<ShowInTaskbar>True</ShowInTaskbar>
	<SingleInstance>False</SingleInstance>
	<ChromeKioskMode>False</ChromeKioskMode>
	<Components>
		<FunctionList name="Subroutines">
			<Components>
				<Function name="csvToJson">
					<Code>var lines=$App[mycsv].split(&quot;\n&quot;);
var result = [];
var headers=lines[0].split(&quot;,&quot;);
for(var i=1;i&lt;lines.length;i++){
      var obj = {};
      var currentline=lines[i].split(&quot;,&quot;);
      for(var j=0;j&lt;headers.length;j++){
          obj[headers[j]] = currentline[j];
      }
      result.push(obj);
}
$App[jsonObject]=result;</Code>
					<Params>mycsv|VARNAME|CSV data variable;jsonObject|VARNAME|JSON object variable</Params>
					<ScriptLanguage>JavaScript</ScriptLanguage>
				</Function>
			</Components>
		</FunctionList>
		<LibraryList name="Libraries"/>
		<PageList name="Main">
			<Components>
				<Page id="NewPage">
					<Components>
						<PushButton id="PushButton1">
							<left>40px</left>
							<top>515px</top>
							<width>340px</width>
							<height>60px</height>
							<caption>CSV to neoTable</caption>
							<click>.Get CSV data into a variable
GetObjectText &quot;Container1&quot; [mycsv]

.Create empty JSON object
CreateEmptyObject [myJson]

.Convert CSV data to JSON (see subroutine).
csvToJson &quot;[mycsv]&quot; &quot;[myJson]&quot;

.Data columns setup
neoTableSetColumn &quot;Container2&quot; 1 &quot;album&quot; &quot;Album&quot; &quot;&quot; true false true &quot;&quot;
neoTableSetColumn &quot;Container2&quot; 2 &quot;year&quot; &quot;Year&quot; &quot;&quot; true false true &quot;&quot;
neoTableSetColumn &quot;Container2&quot; 3 &quot;US_peak_chart_post&quot; &quot;US peak chart post&quot; &quot;&quot; true false true &quot;&quot;

.neoTable Initialization
neoTableInitTable &quot;Container2&quot; &quot;&quot; 0 &quot;Table&quot; true true true true true &quot;showData&quot;

.Data loading
neoTableLoadData &quot;Container2&quot; [myJson]</click>
						</PushButton>
						<Container id="Container1">
							<left>40px</left>
							<top>45px</top>
							<width>340px</width>
							<height>455px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
							<html>album,year,US_peak_chart_post&lt;br&gt;
The White Stripes,1999,-&lt;br&gt;
De Stijl,2000,-&lt;br&gt;
White Blood Cells,2001,61&lt;br&gt;
Elephant,2003,6&lt;br&gt;
Get Behind Me Satan,2005,3&lt;br&gt;
Icky Thump, 2007,2&lt;br&gt;
Under Great White Northern Lights,2010,11&lt;br&gt;
Live in Mississippi,2011,-&lt;br&gt;
Live at the Gold Dollar,2012,-&lt;br&gt;
Nine Miles from the White City,2013,-</html>
						</Container>
						<Container id="Container2">
							<left>395px</left>
							<top>20px</top>
							<width>605px</width>
							<height>560px</height>
							<style>background-color:#fff;border-style:solid;border-width:1px;overflow-y:auto</style>
						</Container>
						<Paragraph id="Paragraph1">
							<left>40px</left>
							<top>20px</top>
							<width>135px</width>
							<height>20px</height>
							<text>CSV Data:</text>
						</Paragraph>
					</Components>
				</Page>
			</Components>
		</PageList>
		<PageList name="Master">
			<Components>
				<Page id="MasterPage"/>
			</Components>
		</PageList>
		<PageList name="Dialog">
			<Components>
				<Page id="NewDialog">
					<Components>
						<DialogContainer id="DialogContainer1">
							<left>0px</left>
							<top>0px</top>
							<width>1024px</width>
							<height>600px</height>
							<close_button>False</close_button>
						</DialogContainer>
					</Components>
				</Page>
			</Components>
		</PageList>
	</Components>
</Application>
