|
Products | PSTextMerge | User Guide Input Tab![]() This tab allows the user to open a new data source for input. The following controls appear on the screen, with the functions as described. Click on the controls to invoke their functions. Open InputClicking on this button will allow you to select the file or directory to be input. Make sure that all of the following controls are properly set before pressing this button. This function can also be invoked via the File/Open Menu item or with the O shortcut key. Type of Data SourceThe default input is a tab-delimited text file, which may have been saved or exported from a spreadsheet, database, address book or other tabular data source. But other options are available as well. Select the one you want from the drop-down list. Following are descriptions of each of the currently available options. Tabbed Data FileThis is a text file. Each line in the file must use tabs (or commas, if the file extension is ".csv") to separate each field, or column, in the line. The first row of the file must contain column headings. These column headings will be used to identify the columns. File DirectoryWhen you specify a file directory as your data source, each entry in that directory will then be treated as if it were a single record, or line, or row, from a data file. The "Maximum Directory Depth" field below will control the depth to which sub-directories are read. The following special column headings are predefined for file directories.
HTML Bookmarks using ListsSetting this option will cause the program to treat the input file as HTML. It will expect the file to contain bookmarks, using nested lists to indicate a folder hierarchy. A table will be created with the following columns. Many bookmark managers, including popular browsers, can save or export bookmarks into this format.
HTML Bookmarks using HeadingsSetting this option will cause the program to treat the input file as HTML. It will expect the file to contain bookmarks, using varying levels of heading tags to indicate a folder hierarchy. A table will be created with the same columns as the HTML Bookmarks using Lists, described above. The contents of the varying heading levels will be placed in Category 1 through 6. HTML TableSetting this option will cause the program to treat the input file as HTML. It will expect the file to contain a table, using table, tr, th and/or td tags. The first row in the table will be expected to contain column headings, with following rows containing the corresponding data. Note that many HTML pages are laid out using tables, not to present columns and rows of data, but to format the page in a desired fashion. Tables containing column headings and following data may often be embedded in such layout tables. In order to try to separate the two, PSTextMerge in this mode will look for the first table cell (within th or td tags) containing 1 to 40 characters of text, with the idea that text beyond either extreme is not likely to be a true column heading. During this search for the first cell of a data table, table cells with colspan or rowspan parameters greater than 1 will also be ignored. In some cases, however, you may need to edit the prospective input file with your favorite text editor, and delete lines preceding and following the table containing the data you are interested in, saving the resulting file as a separate file to be input to PSTextMerge. If a true first column heading is longer than 40 characters, then you will also need to reduce its length to the acceptable 1-40 range. Note that for any HTML input option, character entities found within HTML text will be translated to their equivalent ASCII characters. For now, translation is only provided for characters that are not platform-specific: " " (non-breaking space), "<" (less than sign), ">" (greater than sign), "&" (ampersand) and """ (double quotation marks). Entities may be specified using mnemonics or their numeric equivalents. Basic XMLSetting this option will cause the program to treat the input file as XML. Field names will be stored in columns 1 - 4, with column names "Name1" through "Name4", and field values will be stored in column 5, with column name "Data". Excel SpreadsheetSetting this option will cause the program to treat the input file as a Microsoft Excel spreadsheet. The first or only worksheet (tab) will be accessed. The first row will be expected to contain column headings, with data in following rows. The first blank row will terminate the list. Each row in the spreadsheet (after the first, containing headings) will be treated as a data record, and each column will be treated as a separate field. Columns containing hyperlinks will also generate fields containing the hyperlinks, and named by appending "link" to the column heading. For example, a column named "ISBN" could have its content accessed with the variable "isbn" and its link accessed with the variable "isbnlink". Excel TableSetting this option will also cause the program to treat the input file as a Microsoft Excel spreadsheet. The first or only worksheet (tab) will be accessed. The first blank row will terminate the list. With this option, each row in the spreadsheet will be returned as a single data field, identified by a variable name of "Table Row". The data returned will include beginning and ending td tags for each column, with appropriate formatting and cell dimensions and hyperlinks, mimicking the format of the Excel spreadsheet as closely as possible. The data returned does not include beginning or ending tr tags. PSPub OutlineThis is a special text file format to allow easy representation of an outline structure. Indention is used to indicate outline levels. The first character of the first line is assumed to be the "bullet" character that will subsequently identify all list items. Blank lines indicate paragraph breaks. A line beginning with "a:" (or simply with "http:") identifies a URL to be associated with the preceding outline item. This structure is then converted to a columnar data structure, with one row for each paragraph/list item, and with the following columns.
This columnar data can then be formatted and printed using the appropriate template. Several samples are supplied in the templates folder with the PSTextMerge folder supplied with the application's distribution. Data Dictionary InputClicking on this check box causes the program to look for a special data dictionary file to accompany the tab-delimited data source. The data dictionary file must have the same name as the primary file, but with a file extension of ".dic". The data dictionary file itself is in tab-delimited format. Each row in the file (after the column headings) represents one column in the primary data file. Note that the easiest way to create a data dictionary for a file is to input the file to PSTextMerge (without a dictionary), then Output it with a dictionary (see the Output section for details). You can then edit the resulting file, only modifying the values you wish to change. A dictionary may have the following columns describing the fields in the primary file. Proper NameThis is the column heading that identifies this field in the primary data file. It would normally include mixed-case, spaces and punctuation to make it readable. Common NameThis is really a lowest-common denominator form of the column heading, with capitals, spaces and punctuation all removed. This is used internally by PSTextMerge to allow slight variations in punctuation, etc., without recognizing them as two separate names. Alias ForIf the names previously given should be treated as an alias for another field name, then this column should contain the primary name for the field, and the remaining columns for the alias should be left blank. This feature doesn't do much in this release of PSTextMerge, but should become more meaningful in later releases. Data Format RuleThe default value here is "DataFormatRule", which causes no special formatting of the input data. But specifying another value can cause the input data to be formatted and even converted according to any of the following special rules.
FunctionIf a valid function name is specified here, then the field value will be calculated using the specified function. The following functions are available. The functions make use of the parameters specified in the following columns.
Parm1Used as input to the specified function. Parm2Used as input to the specified function. Parm3Used as input to the specified function. Parm4Used as input to the specified function. Parm5Used as input to the specified function. Merge Into Existing DataSelect one of the following radio buttons to indicate how and whether you want new data to be merged with existing data. No MergeThis is the default. The next data source to be input will overlay any data previously input. Merge New Data With OldThe next input data source to be opened will be merged with the current data visible on the View Tab. Existing sort keys and filters may need to be reapplied. The new data and the old data should have column names that are at least partially overlapping, if not identical. Merge with Same ColumnsThe next input data source to be opened will be merged with the current data visible on the View Tab. The program will not look for column headings in the new input file, but will instead assume that the column names for the new file are the same, and in the same order, as those currently visible on the View Tab. Existing sort keys and filters may need to be reapplied. Note that this merge option is useful for programs (such as AppleWorks) that do not include column headings in their export files. If a separate file is created containing only column headings, then it can be input first, followed by the headerless file, with this merge option. Maximum Directory DepthIf you are about to read a file directory, then this field controls whether sub-directories are read, and to what depth. A value of 1 is the default, and indicates that only files and directories in the specified directory will be listed, with no sub-directory contents. A value of 2 indicates one level of sub-directories, and so forth. Use the Increment and Decrement buttons to change the depth.
Continue with View Tab.
Copyright © 1999-2012 Herb Bowie • All rights reserved • E-mail: http://www.powersurgepub.com/ | input.html | Revised: 1/20/12 |