If you make an error in entering a record, you can go back to the last line with the caret or hat (^) key. After you type the caret key, enter will prompt you with the previous line. If you need to go up two lines, keep typing carets until you get a prompt for the line you wish to reenter.
Name Company Street City State ZIP Phone ---- ------- ------ ---- ----- --- ----- Ronald McDonald McDonald's 123 Mac Attack Memphis TEN N 30000 (111) 222-3333
The row is so long that it wrapped around to the next line. Also, the column names and column data do not line up. Names and Companies and Street Addresses are usually too long to fit nicely into such a table. Therefore, we need a list format like this:
Name Ronald McDonald Company McDonald's Street 123 Mac Attack City Memphis State TENN ZIP 30000 Phone (111) 222-3333
These two formats (table and list) are interchangeable by using the listtotable and tabletolist programs:
$ listtotable < maillist | column Name PhoneName Phone --------------- -------------- Ronald McDonald (111) 222-3333
It is better to use the enter command than an editor on list-formatted files. Otherwise, you must include all of the column names, in the same order and spelled correctly. Follow these simple rules for using enter on list files.
Save the file and use the enter program. Type:
$ enter maillistName _
enter will respond with the first column name and a TAB and wait for you to enter whatever you wish for Name. The underscore (_) shows where your cursor will rest.
$ enter maillistName Chiquita Banana Company Standard Brands Street ^ Company United Brands Street Uno Avenido de la Reforma City San Jose State Costa Rica ZIP 12345-6789 Phone 777-1234
Name <CTRL-d> $
We made an error entering Company and did not realize it until we were at Street. To correct our mistake, we typed caret (^), and enter re-prompted us for Company, allowing us to re-enter the correct response.
$ cat maillistName Ronald McDonald Company McDonald's Street 123 Mac Attack City Memphis State TENN ZIP 30000 Phone (111) 222-3333
Name Chiquita Banana Company United Brands Street Uno Avenido de la Reforma City San Jose State Costa Rica ZIP 12345-6789 Phone 777-1234
The last row (actually eight lines and the bottom newline) is the one we entered. Just hit the return key if you have no data to put after a prompt.
Now for a table example. To add a line to the inventory table, type:
$ enter inventoryItem# Amount Cost Value Description ------- ------- ------- ------- --------------- _
then start typing in your rows. Remember to insert TABs between columns.
8 123 5.98 0 widget 9 29 15.50 0 another widget ^d
Note the control-d represented here by: ^d. The inventory file now looks like this:
$ cat inventory Item Amount Cost Value Description ------- ------- ------- ------- --------------- 1 3 5.00 0 rubber gloves 2 100 0.50 0 test tubes 3 5 8.00 0 clamps 4 23 1.98 0 plates 5 99 2.45 0 cleaning cloth 6 89 14.75 0 bunsen burners 7 5 175 0 scales 8 123 5.98 0 widget 9 29 15.50 0 another widgetSEE ALSO