(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 44692, 1299]*) (*NotebookOutlinePosition[ 45860, 1338]*) (* CellTagsIndexPosition[ 45740, 1331]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["File Input Data Package", "Title", TextAlignment->Center], Cell["\<\ Harry Bishop Process Modeling Solutions, Inc. 26 May 2006\ \>", "Subtitle"], Cell["hrbishop@pmsi-va.com", "Subsubtitle"], Cell["\<\ Importing data into a notebook for manipulation and analysis is an \ important file task. Mathematica comes with the Import function for doing \ just that. Certain data however seems resistant to the approaches of this \ function, for instance part number identification with values such as \ 23E2300000 and 13D3400. Import sees these values as scientific numbers with \ very unwanted results. Additionally, structured data in the form of tables \ could be brought in with default values inserted where blank entries exist. \ By using a header row and a format row before the first row of data, the \ FileInputDataDT package provides a means of producing a fixed length data set \ on each row with a specified format. \ \>", "Text"], Cell["\<\ Usually a structured dataset is produced from a database. By \ providing a set of tools for identifying the data columns and format of the \ data list the FileInputDataDT package sets up the pattern of a data list, \ variables for replacing the list with particular values and a function for \ displaying a data list matched to the format. The package provides for txt \ and csv input file structures. A set of utility functions allows convenience \ in checking for blank or empty data lists.\ \>", "Text"], Cell["\<\ The package recognizes formats: word, date, number, serial, \ currency. Word is the default format for either no format line or when the \ format is not recognized. date reads the string date text and converts it \ into a date\[EmptyVerySmallSquare]time datatype. number reads any number. \ serial reads the text string and unpads leading zeroes so that different \ versions of serial numbers can be compared. currency recognizes the $ sign \ and reads the value as a number. When a blank or empty value is read in the \ datafile the package inserts default values in the following way: word is left blank, date is assigned the file date, serial is left blank, \ currency and number are assigned \[ImaginaryI].\ \>", "Text"], Cell[TextData[{ "The package PMSI`ReadDateTime` is made public to use all the date tools \ contained in this package, especially those related to reading text strings \ containing date data. This package can also be found in the ", StyleBox["Mathematica", FontSlant->"Italic"], " online library under ", StyleBox["Information Science and Technology > Information Technology at \n\ http://library.wolfram.com/infocenter/BySubject/InfoScience/InfoTech/", FontFamily->"Times New Roman", FontSize->13] }], "Text"], Cell[CellGroupData[{ Cell["Reference", "Section"], Cell[CellGroupData[{ Cell["Title", "Subsubsection"], Cell[TextData[StyleBox["File Input Data", FontSlant->"Italic"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Author", "Subsubsection"], Cell["Harry Bishop", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Summary", "Subsubsection"], Cell["\<\ This notebook is a package of functions related to reading text and \ csv files, assigning pattern and variable names and providing data formats \ based on \"word\", \"number\", \"date\", \"serial\", and \"currency\" formats \ as specified in the column headers. A number of functions are available for \ date functions and formatting by using the datatype date\ \[EmptyVerySmallSquare]time from the package PMSI`ReadDateTime`.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Copyright", "Subsubsection"], Cell["\<\ Rights reserved by, Harry Bishop, Process Modeling Solutions, \ Inc.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Notebook Version", "Subsubsection"], Cell["2.0", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " Version" }], "Subsubsection"], Cell["5.2", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["History", "Subsubsection"], Cell[TextData[{ "Reading in data with special formats such as part numbers, serial numbers \ and currency from database downloads to Excel and then txt. or csv. files \ caused mis-interpretations by the ", StyleBox["Mathematica", FontSlant->"Italic"], " Import function even when Conversion Options were used. The problems and \ difficulties with reading parts related databases were the cause of \ implementing this package." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Keywords", "Subsubsection"], Cell["\<\ Database datafiles, textfiles, serial number padding, currency, \ date\[EmptyVerySmallSquare]time, and date strings.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Limitation", "Subsubsection"], Cell[TextData[StyleBox["only the data types mentioned are tested.", FontSlant->"Italic"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Discussion", "Subsubsection"], Cell[TextData[StyleBox["References:\nNone.", FontSlant->"Italic"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Requirements", "Subsubsection"], Cell[TextData[{ StyleBox["Context`FileInputDataDT`\nuses ", FontFamily->"Courier", FontWeight->"Bold", FontSlant->"Italic"], "PMSI`ReadDateTime`;" }], "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Interface", "Section", InitializationCell->True], Cell["\<\ This part declares the publicly visible functions, options, and \ values.\ \>", "Text", InitializationCell->True], Cell[CellGroupData[{ Cell["Set up the package context, including public imports", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell["BeginPackage[\"PMSI`FileInputDataDT`\",{\"PMSI`ReadDateTime`\"}]", \ "Input", InitializationCell->True], Cell[BoxData[ \("PMSI`FileInputDataDT`"\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \($ContextPath\)], "Input"], Cell[BoxData[ \({"PMSI`FileInputDataDT`", "PMSI`ReadDateTime`", "System`"}\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Usage messages for the exported functions and the context \ itself\ \>", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell["\<\ FileInputDataDT::usage = \"FileInputDataDT.m is a package of \ functions related to reading text and csv files, assigning pattern names and \ providing data consructs based on \\\"word\\\", \\\"number\\\", \\\"date\\\", \ \\\"serial\\\", and \\\"currency\\\" formats. In addition, a number of \ functions are available for date and data manipulation. Datatype date\ \[EmptyVerySmallSquare]time is used from package PMSI`ReadDateTime`.\"\ \>", \ "Input", InitializationCell->True], Cell[BoxData[ \("FileInputDataDT.m is a package of functions related to reading text \ and csv files, assigning pattern names and providing data consructs based on \ \"word\", \"number\", \"date\", \"serial\", and \"currency\" formats. In \ addition, a number of functions are available date and data manipulation. \ Datatype date\[EmptyVerySmallSquare]time is used from package \ PMSI`ReadDateTime`."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ showCurrency::usage = \"showCurrency[nr_?NumberQ] pads a number to \ at most 10 digits with a comma every three digits and inserts a dollar \ sign.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("showCurrency[nr_?NumberQ] pads a number to at most 10 digits with a \ comma every three digits and inserts a dollar sign."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ showArow::usage = \"showArow[row_,rowpatt_] provides formatting for \ dates and currency when a rowpatt is provided such as {word,date,currency}.\"\ \ \>", "Input", InitializationCell->True], Cell[BoxData[ \("showArow[row_,rowpatt_] provides formatting for dates and currency \ when a rowpatt is provided such as {word,date,currency}."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ displayDates::usage = \"displayDates[datalist_List,rowForm_] \ formats a listing of data records using TableForm and showArow.\"\ \>", \ "Input", InitializationCell->True], Cell[BoxData[ \("displayDates[datalist_List,rowForm_] formats a listing of data records \ using TableForm and showArow."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ showTHErow::usage = \"showTHErow[row_,rowpatt_] makes a string from \ a formatted date for exporting as a true text value.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("showTHErow[row_,rowpatt_] makes a string from a formatted date for \ exporting as a true text value."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ exportDates::usage = \"exportDates[datalist_List,rowForm_] formats \ a datalisting for export with dates as true text value not wrapped by \ showDates.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("exportDates[datalist_List,rowForm_] formats a datalisting for export \ with dates as true text value not wrapped by showDates."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ nameContains::usage = \"[sName_String,xString_String] provides true \ or false if string sName contains the target string xString.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("[sName_String,xString_String] provides true or false if string sName \ contains the target string xString."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ isEmpty::usage = \"isEmpty[x_List] returns True if x={} otherwise \ False.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("isEmpty[x_List] returns True if x={} otherwise False."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ isNotEmpty::usage = \"isNotEmpty[x_List] returns False if x={} \ otherwise True.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("isNotEmpty[x_List] returns False if x={} otherwise True."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ isBlank::usage = \"isBlank[x_String] returns True if x=\\\"\\\" \ otherwise False.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("isBlank[x_String] returns True if x=\"\" otherwise False."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ isSpace::usage = \"isSpace[x_String] returns True if x=\\\" \\\" \ otherwise False.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("isSpace[x_String] returns True if x=\" \" otherwise False."\)], \ "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Date\[EmptyVerySmallSquare]TimeQ::usage = \ "\"\)], "Input", InitializationCell->True], Cell[BoxData[ \("Date\[EmptyVerySmallSquare]TimeQ[expr] gives True if the head of x is \ date\[EmptyVerySmallSquare]time and False otherwise."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ sortBy::usage = \"sortBy[list_,f_] sorts the list according to the \ ordering function f. So that on using pure functions for f any slot construct \ will work, for instance, #\[LeftDoubleBracket]1\[RightDoubleBracket]& or \ Mean[#]&.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("sortBy[list_,f_] sorts the list according to the ordering function f. \ So that on using pure functions for f any slot construct will work, for \ instance, #\[LeftDoubleBracket]1\[RightDoubleBracket]& or Mean[#]&."\)], \ "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ unPadSerial::usage = \"unPadSerial[x_String] deletes leading zeroes \ from the string. This is used to provide a base number for serial numbers \ used for comparison when the padded zeroes are not consistent.\"\ \>", "Input",\ InitializationCell->True], Cell[BoxData[ \("unPadSerial[x_String] deletes leading zeroes from the string. This is \ used to provide a base number for serial numbers used for comparison when the \ padded zeroes are not consistent."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ readDataFile::usage = \"readDataFile[fileName,options] reads a file \ of data in textfile or CSV format; (tab or comma delimited formats). fileName \ is the full string specifying file location. readDataFile returns the \ following list {titleLine,pattern variables,dataFile,fileName \ abbreviation,column formats,variable names}. Example input cell is: \ {titleLine,pattVars,dataFile,fnAbbr,rowForm,vars} = readFile[ \ fileFolder<>filename.txt,line2format\[Rule]True,abbr\[Rule]test].\"\ \>", \ "Input", InitializationCell->True], Cell[BoxData[ \("readDataFile[fileName,options] reads a file of data in textfile or CSV \ format; (tab or comma delimited formats). fileName is the full string \ specifying file location. readDataFile returns the following list \ {titleLine,pattern variables,dataFile,fileName abbreviation,column \ formats,variable names}. Example input cell is: \ {titleLine,pattVars,dataFile,fnAbbr,rowForm,vars} = readFile[ \ fileFolder<>filename.txt,line2format\[Rule]True,abbr\[Rule]test]."\)], \ "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ line2format::usage = \"line2format is an option indicating that \ line 2 of the input data file contains data type specifications for the \ variables contained in the heading row (line 1). Useable formats are word, \ date, number, serial, and currency. The default option is True.\"\ \>", \ "Input", InitializationCell->True], Cell[BoxData[ \("line2format is an option indicating that line 2 of the input data file \ contains data type specifications for the variables contained in the heading \ row (line 1). Useable formats are word, date, number, serial, and currency. \ The default option is True."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ abbr::usage = \"abbr is an option specifying a shorthand name \ associated with the input data file.The default option is an Input dialog box \ requesting abbr.\"\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("abbr is an option specifying a shorthand name associated with the \ input data file.The default option is an Input dialog box requesting \ abbr."\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ inputDate::usage = \"inputDate is an option specifying the date \ (string) to be used for blank or non-valid entries in columns identified as \ having a date format. The default option is the FileDate of fileName\"\ \>", \ "Input", InitializationCell->True], Cell[BoxData[ \("inputDate is an option specifying the date (string) to be used for \ blank or non-valid entries in columns identified as having a date format. The \ default option is the FileDate of fileName"\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(setVarsToRules::usage = "\"\)], "Input", InitializationCell->True], Cell[BoxData[ \("setVarsToRules[fnAbbr,variableNames] assigns Symbol[variableName] list \ to the pattern elements for use in replacements of data records by the \ element."\)], "Output"] }, Open ]] }, Open ]], Cell["Error messages for the exported objects", "Subsection", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell["Implementation", "Section", InitializationCell->True], Cell["\<\ This part contains the actual definitions and any auxiliary \ functions that should not be visible outside.\ \>", "Text"], Cell[CellGroupData[{ Cell["Begin the private context (implementation part)", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell["\<\ Begin[\"`Private`\"] {$Context,$ContextPath}\ \>", "Input", InitializationCell->True], Cell[BoxData[ \("PMSI`FileInputDataDT`Private`"\)], "Output"], Cell[BoxData[ \({"PMSI`FileInputDataDT`Private`", {"PMSI`FileInputDataDT`", "PMSI`ReadDateTime`", "System`"}}\)], "Output"] }, Open ]] }, Open ]], Cell["Read in any hidden imports", "Subsection", InitializationCell->True], Cell["\<\ Unprotect any system functions for which definitions will be made\ \ \>", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell["\<\ Definition of auxiliary functions and local (static) \ variables\ \>", "Subsection", InitializationCell->True], Cell[BoxData[{ \(\(numberformatpatterns = {"\", "\"};\)\), "\n", \(\(dateformatpatterns = {"\", "\"};\)\), "\n", \(\(serialformatpatterns = {"\", "\"};\)\), "\n", \(\(currencyformatpatterns = {"\", "\"};\)\)}], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[{ \(\(comma = "\<,\>";\)\), "\[IndentingNewLine]", \(\(tab = "\<\t\>";\)\), "\[IndentingNewLine]", \(\ \(cr = "\<\r\>";\)\), "\[IndentingNewLine]", \(\(newline = "\<\n\>";\)\)}], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(tab\\)\\\" is similar to existing symbol \ \\\"\\!\\(Tab\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell[BoxData[ \(\(entryToNumber[v_] := Module[{trueStr = StringQ[v], xStrNumber, replaceSet = {"\<$\>" \[Rule] "\<\>", "\< \>" \[Rule] "\<\>", \ "\<,\>" \[Rule] "\<\>", "\<\"\>" \[Rule] "\<\>"}}, xStrNumber = If[trueStr, StringReplace[v, replaceSet], v]; \[IndentingNewLine]Which[ SameQ[xStrNumber, Null] || Not[trueStr] || isBlank[xStrNumber], \[ImaginaryI], trueStr && DigitQ[StringReplace[ xStrNumber, {"\<.\>" \[Rule] "\<\>", "\<-\>" \[Rule] \ "\<\>"}]], ToExpression[xStrNumber], True, \[ImaginaryI]]];\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(dateconvert[x_String, usefileDate_date\[EmptyVerySmallSquare]time] := With[{strX = StringReplace[ x, {"\<\"\>" \[Rule] "\<\>", "\<\\\>" \[Rule] "\<\>"}]}, Which[isBlank[strX] || isSpace[strX] || Not[valid\[EmptyVerySmallSquare]dateQ[strX]], usefileDate, True, make\[Ellipsis]date\[EmptyVerySmallSquare]time[ deconstructDate[strX]]]];\)\)], "Input", InitializationCell->True], Cell[BoxData[{ \(\(isNumberIndicator[x_] := Block[{StringMatchQ, Or}, Thread[StringMatchQ[x, Or @@ numberformatpatterns], Or]];\)\), "\n", \(\(isDateIndicator[x_] := Block[{StringMatchQ, Or}, Thread[StringMatchQ[x, Or @@ dateformatpatterns], Or]];\)\), "\n", \(\(isSerialIndicator[x_] := Block[{StringMatchQ, Or}, Thread[StringMatchQ[x, Or @@ serialformatpatterns], Or]];\)\), "\n", \(\(isCurrencyIndicator[x_] := Block[{StringMatchQ, Or}, Thread[StringMatchQ[x, Or @@ currencyformatpatterns], Or]];\)\)}], "Input", InitializationCell->True], Cell[BoxData[{ \(\(deleteLead0s[{first_, rest__} /; SameQ[first, "\<0\>"]] := deleteLead0s[{rest}];\)\), "\n", \(\(deleteLead0s[l_List] := l;\)\)}], "Input", InitializationCell->True], Cell[BoxData[ \(\(fixedLength[list_List, length_Integer, blankList_List] := With[{lsize = Length[list]}, Which[lsize \[Equal] length, list, \[IndentingNewLine]lsize > length, Take[list, length], \[IndentingNewLine]True, Join[list, Take[blankList, length - lsize]]]];\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(textInFormat[s_String] := Which[isNumberIndicator[s], "\", isDateIndicator[s], "\", isSerialIndicator[s], "\", isCurrencyIndicator[s], "\", True, "\"];\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(textToFormat[x_List, toFormat_List, usefileDate_date\[EmptyVerySmallSquare]time] := \ \(\(\(\(MapThread[{#1, #2} &, {toFormat, x}] /. \[IndentingNewLine]{form_, value_} /; form \[Equal] "\" \[RuleDelayed] value\) /. \[IndentingNewLine]{form_, value_} /; form \[Equal] "\" \[RuleDelayed] entryToNumber[value]\) /. {form_, value_} /; form \[Equal] "\" \[RuleDelayed] dateconvert[value, usefileDate]\) /. {form_, value_} /; form \[Equal] "\" \[RuleDelayed] unPadSerial[value]\) /. {form_, value_} /; form \[Equal] "\" \[RuleDelayed] entryToNumber[value];\)\)], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(value\\)\\\" is similar to existing symbol \ \\\"\\!\\(Value\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell[BoxData[ \(\(assignTest[format_String] := \[IndentingNewLine]Switch[ format, \[IndentingNewLine]"\", "\<_?StringQ\>", \ \[IndentingNewLine]"\", "\<_?NumberQ\>", \ \[IndentingNewLine]"\", "\<_?Date\[EmptyVerySmallSquare]TimeQ\>", \ \[IndentingNewLine]"\", "\<_?StringQ\>", \ \[IndentingNewLine]"\", "\<_?NumberQ\>", \[IndentingNewLine]_, \ "\<_?StringQ\>"];\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ \(\(assignForm[fn_String, v_List, form_String] := With[{symbolName = fn <> form}, Clear[symbolName]; \[IndentingNewLine]Switch[ form, \[IndentingNewLine]"\", Evaluate[Symbol[symbolName]] = v, \[IndentingNewLine]"\", Evaluate[Symbol[symbolName]] = v, \[IndentingNewLine]"\", Evaluate[Symbol[symbolName]] = MapThread[ ToExpression["\" <> ToString[#1] <> assignTest[#2]] &, {Range[Length[v]], v}]]\[IndentingNewLine]];\)\)], "Input", InitializationCell->True], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(symbolName\\)\\\" is similar to existing \ symbol \\\"\\!\\(SymbolName\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message"] }, Open ]], Cell[BoxData[{ \(\(setRule[symbolName_, rule_] := With[{}, Clear[symbolName]; Evaluate[Symbol[symbolName]] = rule];\)\), "\n", \(\(eVars[n_Integer] := Table[Symbol["\" <> ToString[i]], {i, 1, n}];\)\)}], "Input", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell["Definition of the exported functions", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[TextData[StyleBox["formatting functions", "Input"]], "Subsubsection", InitializationCell->True], Cell[BoxData[ \(\(showCurrency[nr_?NumberQ] := PaddedForm[nr, {10, 2}, DigitBlock \[Rule] 3, NumberSeparator \[Rule] "\<,\>", NumberSigns \[Rule] {"\<-$\>", "\<$\>"}, ExponentFunction \[Rule] \((If[\(-10\) < # < 10, Null, #] &)\)];\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(showArow[row_, rowpatt_] := MapThread[\[IndentingNewLine]Which[#2 \[Equal] "\", ddMMMyy[#1], \[IndentingNewLine]#2 \[Equal] "\", showCurrency[#1], \[IndentingNewLine]True, #1] &, {row, rowpatt}];\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(displayDates[datalist_List, rowForm_] := TableForm[Map[showArow[#, rowForm] &, datalist]];\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(showTHErow[row_, rowpatt_] := MapThread[ If[#2 \[Equal] "\", ToString[displayDTG[#1, "\"]], #1] &, {row, rowpatt}];\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(exportDates[datalist_List, rowForm_] := Map[showTHErow[#, rowForm] &, datalist];\)\)], "Input", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["utility functions", "Input"]], "Subsubsection", InitializationCell->True], Cell[BoxData[ \(\(nameContains[sName_String, xString_String] := StringPosition[sName, xString] \[NotEqual] {};\)\)], "Input", InitializationCell->True], Cell[BoxData[ \(\(isEmpty[x_List] := Flatten[x] \[Equal] {};\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(isNotEmpty[x_List] := Flatten[x] \[NotEqual] {};\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(isBlank[x_String] := x \[Equal] "\<\>";\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(isSpace[x_String] := x \[Equal] "\< \>";\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(sortBy[list_, f_] := list[\([Ordering[Map[f, list]]]\)];\)\)], "Input",\ InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ \(\(unPadSerial[x_String] := StringJoin[deleteLead0s[Characters[x]]];\)\)], "Input", InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[{ \(\(Date\[EmptyVerySmallSquare]TimeQ[x_date\[EmptyVerySmallSquare]time] := True;\)\), "\[IndentingNewLine]", \(\(Date\[EmptyVerySmallSquare]TimeQ[x_] := False;\)\)}], "Input", InitializationCell->True], Cell[BoxData[ \(\(setVarsToRules[fnAbr_, varStr_] := MapThread[ setRule[#1, Symbol[fnAbr <> "\"] \[RuleDelayed] #2] &, {varStr, eVars[Length[varStr]]}];\)\)], "Input", InitializationCell->True, CellTags->{"Data Routines", "close Data Routines"}] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["readfile", "Input"]], "Subsubsection", InitializationCell->True], Cell[BoxData[ \(\(Options[readDataFile] = {line2format \[Rule] True, abbr \[Rule] "\<\>", inputDate \[Rule] "\<\>"};\)\)], "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{\(readDataFile[fileName_, opts___?OptionQ]\), ":=", RowBox[{"Module", "[", RowBox[{\({fn, fnAbbr, returnedDate, result, nullresult, r, rHead, size, blankLine, readFormat, headingLine, header, formatLine, line2indication, inFormat, rList, separator, datestring, refFileDate}\), ",", "\[IndentingNewLine]", RowBox[{\(nullresult = {Null, Null, Null, Null, Null, Null}\), ";", "\[IndentingNewLine]", \({line2indication, fnAbbr, datestring} = \({line2format, abbr, inputDate} /. {opts}\) /. Options[readDataFile]\), ";", "\[IndentingNewLine]", \(returnedDate = FileDate[fileName]\), ";", "\[IndentingNewLine]", RowBox[{"result", "=", RowBox[{"Catch", "[", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{\(SameQ[returnedDate, $Failed]\), ",", \(Throw[nullresult]\), ",", "\[IndentingNewLine]", RowBox[{"(", RowBox[{\(refFileDate = dateconvert[datestring, make\[Ellipsis]date\[EmptyVerySmallSquare]time[ returnedDate]]\), ";", "\[IndentingNewLine]", RowBox[{"fn", "=", RowBox[{ RowBox[{"Switch", "[", RowBox[{ "fnAbbr", ",", "\"\<\>\"", ",", "\[IndentingNewLine]", RowBox[{"ToString", "[", RowBox[{"Input", "[", RowBox[{ "fileName", "<>", "\"\< - \!\(\* StyleBox[\"abbreviation\",\nFontFamily->\"Century Schoolbook\",\n\ FontSlant->\"Italic\",\nFontColor->GrayLevel[0.100008],\n\ Background->RGBColor[1, 1, 0]]\)?\>\""}], "]"}], "]"}], ",", "_", ",", "fnAbbr"}], "]"}], "<>", "\"\<\[EmptyVerySmallSquare]\>\""}]}], ";", "\[IndentingNewLine]", \(separator = Which[nameContains[fileName, "\<.csv\>"], comma, nameContains[fileName, "\<.mcsv\>"], comma, nameContains[fileName, "\<.txt\>"], tab, \[IndentingNewLine]True, Input["\"]]\), ";", "\[IndentingNewLine]", \(rseparator = {cr, newline}\), ";", "\[IndentingNewLine]", \(r = OpenRead[fileName]\), ";", "\n", \(rHead = Read[r, String]\), ";", \(rHead = StringReplace[ rHead, {"\< \>" \[Rule] "\<\>", "\<_\>" \[Rule] \ "\<\>", "\<[\>" \[Rule] "\<\>", "\<]\>" \[Rule] "\<\>", "\<(\>" \[Rule] \ "\<\>", "\<)\>" \[Rule] "\<\>"}]\), ";", "\[IndentingNewLine]", \(size = Length[ Union[ Flatten[ StringPosition[rHead, separator]]]] + 1\), ";", "\n", \(readFormat = Table[Word, {i, 1, size}]\), ";", "\[IndentingNewLine]", \(blankLine = Table["\<\>", {i, 1, size}]\), ";", "\n", \(If[ line2indication, \((formatLine = Read[r, readFormat, WordSeparators \[Rule] separator, RecordSeparators \[Rule] rseparator, NullWords \[Rule] True]; \[IndentingNewLine]inFormat = Map[textInFormat[#] &, formatLine]; \[IndentingNewLine]Skip[r, Word, WordSeparators \[Rule] separator, RecordSeparators \[Rule] rseparator, NullWords \[Rule] True])\), \[IndentingNewLine]inFormat = Table["\", {i, 1, size}]]\), ";", \(rList = ReadList[r, Word, WordSeparators \[Rule] separator, RecordSeparators \[Rule] rseparator, NullWords \[Rule] True, RecordLists \[Rule] True]\), ";", "\[IndentingNewLine]", \(rList = Map[fixedLength[#, size, blankLine] &, rList]\), ";", "\[IndentingNewLine]", \(rList = If[line2indication, Map[textToFormat[#, inFormat, refFileDate] &, rList], rList]\), ";", "\[IndentingNewLine]", \(headingLine = Read[StringToStream[rHead], readFormat, WordSeparators \[Rule] separator, NullWords \[Rule] True]\), ";", "\[IndentingNewLine]", \(header = Map[StringInsert[#, fn, 1] &, headingLine]\), ";", "\[IndentingNewLine]", \(rowFormat = assignForm[fn, inFormat, "\"]\), ";", "\[IndentingNewLine]", \(pattFormat = assignForm[fn, inFormat, "\"]\), ";", "\[IndentingNewLine]", \(varsFormat = assignForm[fn, header, "\"]\), ";", "\[IndentingNewLine]", \(Close[r]\), ";", "\[IndentingNewLine]", \(Print[headingLine]\), ";", "\[IndentingNewLine]", \(Print[ fn <> "\", rowFormat]\), ";", "\[IndentingNewLine]", \(Print[fn <> "\", pattFormat]\), ";", "\[IndentingNewLine]", \(Print[fn <> "\", varsFormat]\), ";", "\n", \({headingLine, pattFormat, rList, fn, rowFormat, varsFormat}\)}], ")"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", \(If[ SameQ[result, nullresult], \ \[IndentingNewLine]\((Print[\[IndentingNewLine]StyleForm["\", FontFamily \[Rule] "\", FontWeight \[Rule] "\", FontColor \[Rule] Red], StyleForm[fileName, FontFamily \[Rule] "\", FontSlant \[Rule] "\"]]; \ \[IndentingNewLine]nullresult)\), \[IndentingNewLine]result]\)}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", PageWidth->WindowWidth, InitializationCell->True, CellAutoOverwrite->False], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(fnAbbr\\)\\\" is similar to existing symbol \ \\\"\\!\\(fnAbr\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(rHead\\)\\\" is similar to existing symbol \ \\\"\\!\\(Head\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(size\\)\\\" is similar to existing symbol \\\ \"\\!\\(lsize\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell1\\\"\\) will be suppressed during this \ calculation. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], "Message"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["End the private context", "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell["End[ ]", "Input", InitializationCell->True], Cell[BoxData[ \("PMSI`FileInputDataDT`Private`"\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Epilog", "Section", InitializationCell->True], Cell["This section protects exported symbols and ends the package.", "Text"], Cell[CellGroupData[{ Cell["Protect exported symbol", "Subsection", InitializationCell->True], Cell["Alternative: protect all exported symbols", "Text", InitializationCell->True], Cell["Protect[Evaluate[$Context <> \"*\"]]", "Input", Evaluatable->False, InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell["End the package context", "Subsection", InitializationCell->True], Cell["EndPackage[ ]", "Input", InitializationCell->True] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Examples, Tests", "Section"], Cell[TextData[StyleBox["Examples, tests for the use of the package can go \ here.", FontSlant->"Italic"]], "Text"], Cell["\<\ The options allow specification of a format line (default is true), \ a filename abbreviation (default is to ask for input), and an input Date to \ use for blank or invalid date entries. The default date is the file date.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Options[readDataFile]\)], "Input"], Cell[BoxData[ \({line2format \[Rule] True, abbr \[Rule] \*"\<\"\"\>", inputDate \[Rule] \*"\<\"\"\>"}\)], "Output"] }, Open ]], Cell["File Path results in an invalid file.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\({titleLine, pattVars, dataFile, fnAbbr, rowForm, vars} = readDataFile[\ "\"];\)\)], \ "Input", PageWidth->WindowWidth, CellAutoOverwrite->False], Cell[BoxData[ RowBox[{\(FileDate::"nffil"\), \(\(:\)\(\ \)\), "\<\"File not found \ during \\!\\(FileDate[\\\"/File Organizer/OR Tools/test file\\\"]\\). \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::nffil\\\"]\\)\"\>"}]], \ "Message"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[ StyleBox["\<\"No such file \"\>", FontFamily->"Century Schoolbook", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], ( StyleForm[ #, FontFamily -> "Century Schoolbook", FontWeight -> "Bold", FontColor -> RGBColor[ 1, 0, 0]]&)], "\[InvisibleSpace]", TagBox[ StyleBox["\<\"/File Organizer/OR Tools/test file\"\>", FontFamily->"Courier", FontSlant->"Italic"], (StyleForm[ #, FontFamily -> "Courier", FontSlant -> "Italic"]&)]}], SequenceForm[ StyleForm[ "No such file ", FontFamily -> "Century Schoolbook", FontWeight -> "Bold", FontColor -> RGBColor[ 1, 0, 0]], StyleForm[ "/File Organizer/OR Tools/test file", FontFamily -> "Courier", FontSlant -> "Italic"]], Editable->False]], "Print"] }, Open ]], Cell["\<\ Correcting the filename by putting on the extension results in a \ valid read and return of variables.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\({titleLine, pattVars, dataFile, fnAbbr, rowForm, vars} = readDataFile[\ "\"];\)\)], \ "Input", PageWidth->WindowWidth, CellAutoOverwrite->False], Cell[BoxData[ \({"Date", "PartID", "InserviceHours", "Machine", "Cost", "Note"}\)], "Print"], Cell[BoxData[ InterpretationBox[\("test\[EmptyVerySmallSquare]rowForm ="\ \[InvisibleSpace]{"date", "serial", "number", "word", "currency", "word"}\), SequenceForm[ "test\[EmptyVerySmallSquare]rowForm =", {"date", "serial", "number", "word", "currency", "word"}], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("test\[EmptyVerySmallSquare]patt \ ="\[InvisibleSpace]{e1_?Date\[EmptyVerySmallSquare]TimeQ, e2_?StringQ, e3_?NumberQ, e4_?StringQ, e5_?NumberQ, e6_?StringQ}\), SequenceForm[ "test\[EmptyVerySmallSquare]patt =", { PatternTest[ Pattern[ e1, Blank[ ]], Date\[EmptyVerySmallSquare]TimeQ], PatternTest[ Pattern[ e2, Blank[ ]], StringQ], PatternTest[ Pattern[ e3, Blank[ ]], NumberQ], PatternTest[ Pattern[ e4, Blank[ ]], StringQ], PatternTest[ Pattern[ e5, Blank[ ]], NumberQ], PatternTest[ Pattern[ e6, Blank[ ]], StringQ]}], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[\("test\[EmptyVerySmallSquare]vars \ ="\[InvisibleSpace]{"test\[EmptyVerySmallSquare]Date", "test\[EmptyVerySmallSquare]PartID", "test\[EmptyVerySmallSquare]InserviceHours", "test\[EmptyVerySmallSquare]Machine", "test\[EmptyVerySmallSquare]Cost", "test\[EmptyVerySmallSquare]Note"}\), SequenceForm[ "test\[EmptyVerySmallSquare]vars =", {"test\[EmptyVerySmallSquare]Date", "test\[EmptyVerySmallSquare]PartID", "test\[EmptyVerySmallSquare]InserviceHours", "test\[EmptyVerySmallSquare]Machine", "test\[EmptyVerySmallSquare]Cost", "test\[EmptyVerySmallSquare]Note"}], Editable->False]], "Print"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dataFile\)], "Input"], Cell[BoxData[ \({{date\[EmptyVerySmallSquare]time[2006, 5, 26, 0, 0, 0, 38861.`], "23E400", 140.2`, "A", 500.`, "Purchased"}, {date\[EmptyVerySmallSquare]time[2005, 1, 5, 0, 0, 0, 38355.`], "23E400", 100, "A", 1.`, "Sold"}, {date\[EmptyVerySmallSquare]time[1854, 2, 4, 0, 0, 0, \(-16767.`\)], "100D3500", 10, "C", 25.`, "Tested"}}\)], "Output"] }, Open ]], Cell["\<\ Establish rules between the data list pattern and individual \ elements identified by the variable names\ \>", "Text"], Cell[BoxData[ \(\(setVarsToRules[fnAbbr, vars];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(vars\)], "Input"], Cell[BoxData[ \({"test\[EmptyVerySmallSquare]Date", "test\[EmptyVerySmallSquare]PartID", "test\[EmptyVerySmallSquare]InserviceHours", "test\[EmptyVerySmallSquare]Machine", "test\[EmptyVerySmallSquare]Cost", "test\[EmptyVerySmallSquare]Note"}\)], "Output"] }, Open ]], Cell["\<\ Individual elements of a data list can be retrieved in the \ following way:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(dataFile /. test\[EmptyVerySmallSquare]Cost\), "\[IndentingNewLine]", \(dataFile /. test\[EmptyVerySmallSquare]Note\)}], "Input"], Cell[BoxData[ \({500.`, 1.`, 25.`}\)], "Output"], Cell[BoxData[ \({"Purchased", "Sold", "Tested"}\)], "Output"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Macintosh", ScreenRectangle->{{0, 1676}, {0, 1028}}, AutoGeneratedPackage->Automatic, WindowToolbars->"EditBar", WindowSize->{955, 1005}, WindowMargins->{{310, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, ShowSelection->True ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "Data Routines"->{ Cell[27926, 873, 307, 7, 43, "Input", InitializationCell->True, CellTags->{"Data Routines", "close Data Routines"}]}, "close Data Routines"->{ Cell[27926, 873, 307, 7, 43, "Input", InitializationCell->True, CellTags->{"Data Routines", "close Data Routines"}]} } *) (*CellTagsIndex CellTagsIndex->{ {"Data Routines", 45420, 1319}, {"close Data Routines", 45581, 1323} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 65, 1, 88, "Title"], Cell[1844, 56, 85, 4, 112, "Subtitle"], Cell[1932, 62, 43, 0, 28, "Subsubtitle"], Cell[1978, 64, 747, 11, 78, "Text"], Cell[2728, 77, 519, 8, 62, "Text"], Cell[3250, 87, 740, 11, 94, "Text"], Cell[3993, 100, 529, 11, 68, "Text"], Cell[CellGroupData[{ Cell[4547, 115, 28, 0, 69, "Section"], Cell[CellGroupData[{ Cell[4600, 119, 30, 0, 28, "Subsubsection"], Cell[4633, 121, 74, 1, 32, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4744, 127, 31, 0, 28, "Subsubsection"], Cell[4778, 129, 28, 0, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4843, 134, 32, 0, 28, "Subsubsection"], Cell[4878, 136, 452, 7, 62, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5367, 148, 34, 0, 28, "Subsubsection"], Cell[5404, 150, 92, 3, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5533, 158, 41, 0, 28, "Subsubsection"], Cell[5577, 160, 19, 0, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5633, 165, 101, 4, 28, "Subsubsection"], Cell[5737, 171, 19, 0, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5793, 176, 32, 0, 28, "Subsubsection"], Cell[5828, 178, 449, 9, 64, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6314, 192, 33, 0, 28, "Subsubsection"], Cell[6350, 194, 140, 3, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6527, 202, 35, 0, 28, "Subsubsection"], Cell[6565, 204, 100, 1, 32, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6702, 210, 35, 0, 28, "Subsubsection"], Cell[6740, 212, 77, 1, 50, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6854, 218, 37, 0, 28, "Subsubsection"], Cell[6894, 220, 174, 6, 48, "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7117, 232, 56, 1, 69, "Section", InitializationCell->True], Cell[7176, 235, 125, 4, 30, "Text", InitializationCell->True], Cell[CellGroupData[{ Cell[7326, 243, 102, 1, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[7453, 248, 111, 2, 27, "Input", InitializationCell->True], Cell[7567, 252, 57, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7661, 258, 45, 1, 27, "Input"], Cell[7709, 261, 92, 1, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7850, 268, 124, 4, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[7999, 276, 492, 9, 72, "Input", InitializationCell->True], Cell[8494, 287, 420, 6, 75, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8951, 298, 202, 5, 42, "Input", InitializationCell->True], Cell[9156, 305, 157, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9350, 312, 202, 5, 42, "Input", InitializationCell->True], Cell[9555, 319, 161, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9753, 326, 183, 5, 42, "Input", InitializationCell->True], Cell[9939, 333, 138, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10114, 340, 177, 4, 42, "Input", InitializationCell->True], Cell[10294, 346, 136, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10467, 353, 206, 5, 42, "Input", InitializationCell->True], Cell[10676, 360, 162, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10875, 367, 185, 4, 42, "Input", InitializationCell->True], Cell[11063, 373, 142, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11242, 380, 129, 4, 27, "Input", InitializationCell->True], Cell[11374, 386, 89, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11500, 392, 135, 4, 27, "Input", InitializationCell->True], Cell[11638, 398, 92, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11767, 404, 137, 4, 27, "Input", InitializationCell->True], Cell[11907, 410, 93, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12037, 416, 138, 4, 27, "Input", InitializationCell->True], Cell[12178, 422, 96, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12311, 429, 235, 4, 27, "Input", InitializationCell->True], Cell[12549, 435, 160, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12746, 442, 288, 6, 42, "Input", InitializationCell->True], Cell[13037, 450, 251, 4, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13325, 459, 265, 6, 57, "Input", InitializationCell->True], Cell[13593, 467, 221, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13851, 475, 544, 10, 87, "Input", InitializationCell->True], Cell[14398, 487, 501, 8, 75, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14936, 500, 337, 7, 57, "Input", InitializationCell->True], Cell[15276, 509, 293, 4, 59, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15606, 518, 215, 5, 42, "Input", InitializationCell->True], Cell[15824, 525, 180, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16041, 533, 269, 6, 57, "Input", InitializationCell->True], Cell[16313, 541, 227, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16577, 549, 245, 4, 59, "Input", InitializationCell->True], Cell[16825, 555, 190, 3, 43, "Output"] }, Open ]] }, Open ]], Cell[17042, 562, 89, 1, 38, "Subsection", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[17168, 568, 61, 1, 69, "Section", InitializationCell->True], Cell[17232, 571, 131, 3, 30, "Text"], Cell[CellGroupData[{ Cell[17388, 578, 97, 1, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[17510, 583, 97, 4, 42, "Input", InitializationCell->True], Cell[17610, 589, 65, 1, 27, "Output"], Cell[17678, 592, 136, 2, 27, "Output"] }, Open ]] }, Open ]], Cell[17841, 598, 76, 1, 38, "Subsection", InitializationCell->True], Cell[17920, 601, 125, 4, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[18070, 609, 122, 4, 38, "Subsection", InitializationCell->True], Cell[18195, 615, 306, 5, 75, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[18526, 624, 247, 5, 75, "Input", InitializationCell->True], Cell[18776, 631, 354, 5, 21, "Message"] }, Open ]], Cell[19145, 639, 688, 14, 91, "Input", InitializationCell->True], Cell[19836, 655, 491, 9, 75, "Input", InitializationCell->True], Cell[20330, 666, 681, 16, 91, "Input", InitializationCell->True], Cell[21014, 684, 203, 4, 43, "Input", InitializationCell->True], Cell[21220, 690, 400, 8, 91, "Input", InitializationCell->True], Cell[21623, 700, 301, 6, 43, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[21949, 710, 873, 15, 123, "Input", InitializationCell->True], Cell[22825, 727, 358, 5, 21, "Message"] }, Open ]], Cell[23198, 735, 461, 8, 139, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[23684, 747, 648, 12, 139, "Input", InitializationCell->True], Cell[24335, 761, 370, 6, 21, "Message"] }, Open ]], Cell[24720, 770, 282, 6, 43, "Input", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[25039, 781, 86, 1, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[25150, 786, 102, 1, 27, "Subsubsection", InitializationCell->True], Cell[25255, 789, 339, 7, 43, "Input", InitializationCell->True], Cell[25597, 798, 330, 6, 75, "Input", InitializationCell->True], Cell[25930, 806, 164, 3, 27, "Input", InitializationCell->True], Cell[26097, 811, 248, 6, 43, "Input", InitializationCell->True], Cell[26348, 819, 154, 3, 27, "Input", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[26539, 827, 99, 1, 27, "Subsubsection", InitializationCell->True], Cell[26641, 830, 166, 3, 27, "Input", InitializationCell->True], Cell[26810, 835, 135, 3, 27, "Input", InitializationCell->True], Cell[26948, 840, 141, 3, 27, "Input", InitializationCell->True], Cell[27092, 845, 132, 3, 27, "Input", InitializationCell->True], Cell[27227, 850, 133, 3, 27, "Input", InitializationCell->True], Cell[27363, 855, 151, 4, 27, "Input", InitializationCell->True], Cell[27517, 861, 167, 4, 27, "Input", InitializationCell->True], Cell[27687, 867, 236, 4, 43, "Input", InitializationCell->True], Cell[27926, 873, 307, 7, 43, "Input", InitializationCell->True, CellTags->{"Data Routines", "close Data Routines"}] }, Open ]], Cell[CellGroupData[{ Cell[28270, 885, 90, 1, 27, "Subsubsection", InitializationCell->True], Cell[28363, 888, 174, 3, 27, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[28562, 895, 7623, 129, 827, "Input", InitializationCell->True], Cell[36188, 1026, 359, 5, 21, "Message"], Cell[36550, 1033, 357, 5, 21, "Message"], Cell[36910, 1040, 357, 5, 21, "Message"], Cell[37270, 1047, 333, 5, 21, "Message"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[37664, 1059, 73, 1, 38, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[37762, 1064, 51, 1, 27, "Input", InitializationCell->True], Cell[37816, 1067, 65, 1, 27, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[37942, 1075, 53, 1, 69, "Section", InitializationCell->True], Cell[37998, 1078, 76, 0, 30, "Text"], Cell[CellGroupData[{ Cell[38099, 1082, 73, 1, 38, "Subsection", InitializationCell->True], Cell[38175, 1085, 85, 1, 30, "Text", InitializationCell->True], Cell[38263, 1088, 103, 2, 27, "Input", Evaluatable->False, InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[38403, 1095, 73, 1, 38, "Subsection", InitializationCell->True], Cell[38479, 1098, 58, 1, 27, "Input", InitializationCell->True] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[38586, 1105, 34, 0, 69, "Section"], Cell[38623, 1107, 116, 2, 32, "Text"], Cell[38742, 1111, 245, 5, 46, "Text"], Cell[CellGroupData[{ Cell[39012, 1120, 54, 1, 27, "Input"], Cell[39069, 1123, 126, 2, 27, "Output"] }, Open ]], Cell[39210, 1128, 53, 0, 30, "Text"], Cell[CellGroupData[{ Cell[39288, 1132, 216, 5, 43, "Input"], Cell[39507, 1139, 324, 5, 21, "Message"], Cell[39834, 1146, 974, 25, 23, "Print"] }, Open ]], Cell[40823, 1174, 126, 3, 30, "Text"], Cell[CellGroupData[{ Cell[40974, 1181, 220, 5, 43, "Input"], Cell[41197, 1188, 103, 2, 23, "Print"], Cell[41303, 1192, 323, 6, 23, "Print"], Cell[41629, 1200, 808, 23, 23, "Print"], Cell[42440, 1225, 746, 15, 23, "Print"] }, Open ]], Cell[CellGroupData[{ Cell[43223, 1245, 41, 1, 27, "Input"], Cell[43267, 1248, 397, 6, 59, "Output"] }, Open ]], Cell[43679, 1257, 128, 3, 30, "Text"], Cell[43810, 1262, 66, 1, 27, "Input"], Cell[CellGroupData[{ Cell[43901, 1267, 37, 1, 27, "Input"], Cell[43941, 1270, 294, 6, 27, "Output"] }, Open ]], Cell[44250, 1279, 99, 3, 30, "Text"], Cell[CellGroupData[{ Cell[44374, 1286, 155, 2, 43, "Input"], Cell[44532, 1290, 52, 1, 27, "Output"], Cell[44587, 1293, 65, 1, 27, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)