Data to Table, Example 2 It may happen that the data in one or more cells contains the character that is used to separate the data in each cell in a row. For example, one might want the following data:
Wilson, Ralph, 33, Kansas City, KS, pilot Poniatowski, Mabel, 21, Chico, CA, waitress (works at Hungry Hunter) Jefferson, Clarence, 101, Dayton, OH, retiredto appear not as:
but rather as:
Wilson Ralph 33 Kansas City KS pilot Poniatowski Mabel 21 Chico CA waitress (works at Hungry Hunter) Jefferson Clarence 101 Dayton OH retired
Also, perhaps column headings, such as:
Wilson, Ralph 33 Kansas City, KS pilot Poniatowski, Mabel 21 Chico, CA waitress (works at
Hungry Hunter)Jefferson, Clarence 101 Dayton, OH retired
And a bit of color:
Name Age City Occupation Wilson, Ralph 33 Kansas City, KS pilot Poniatowski, Mabel 21 Chico, CA waitress (works at
Hungry Hunter)Jefferson, Clarence 101 Dayton, OH retired
Some rules of use given on the Data to Table page should be observed when preparing data in a text file for conversion:
Wilson, Ralph 33 Kansas City, KS pilot Poniatowski, Mabel 21 Chico, CA waitress (works at
Hungry Hunter)Jefferson, Clarence 101 Melbourne, FL retired
- When a comma is used as a separator and also occurs within the data in a cell it should be preceded by \.
- A line which consists of one or more headings should be preceded by \TH (for "Table Heading").
- If a line break is to occur within the text in a cell then it should be marked by \! (i.e., a backslash plus an exclamation mark).
Numbers (data beginning with '+', '-' or a digit) are aligned right. The program allows you to center text in cells (text, if not centered, is aligned left).
For blank cells use the separator character (or if the separator character is the space then use "\ ", i.e., a backslash plus a space).
The following data (suppose it is in a file called DATA.TXT) illustrates these conventions:
\THFamily Jefferson,,,, \THName, ,City Poniatowski\, Michael, 44, Fredericksburg\, TX\!(settled by Germans), bank manager Wilson\, Ralph Poniatowski\, Mabel, 21, Chico\, CA, waitress (works at\!Hungry Hunger) Jefferson\, Clarence, 101, Dayton\, OH, retiredThe input and output files are specified in the usual way and other parameters are set up:
You can now specify the text and background colors for the table by clicking on Specify table colors and selecting new colors, for example:
Clicking on Convert data to table creates the output file DATA.HTM which is displayed in a browser as:
Family Jefferson Name City Poniatowski, Michael 44 Fredericksburg, TX
(settled by Germans)bank manager Wilson, Ralph Poniatowski, Mabel 21 Chico, CA waitress (works at
Hungry Hunger)Jefferson, Clarence 101 Melbourne, FL retired The only editing we need to do is to replace:
with:
<tr><th><font color="#640014">Family Jefferson</font></th> <th><font color="#640014"> </font></th> <th><font color="#640014"> </font></th> <th><font color="#640014"> </font></th> </tr>to give:
<tr><th COLSPAN=4><font color="#640014">Family Jefferson</font></th></tr>
Family Jefferson Name City Poniatowski, Michael 44 Fredericksburg, TX
(settled by Germans)bank manager Wilson, Ralph Poniatowski, Mabel 21 Chico, CA waitress (works at
Hungry Hunger)Jefferson, Clarence 101 Melbourne, FL retired
Example 1 Data to Table Easy HTML Construction Kit Home Page