|
|
| Everything HP200LX: Knowledge, Products, Service |
|
Using the Data Parse CommandSuppose you've tried the above DIR commands and you still want to get a listing of the files in the C:\_DAT directory sorted first by their extensions and then by their sizes from the largest to the smallest. Here's how to do this task. In Filer, point at the C:\_DAT directory and press Enter. Then press Menu, Options, DOS. At the DOS prompt type the command DIR, /OES > files.prn (Don't forget the comma). The '>' redirection symbol will send the output to a file called "files.prn". Now type Exit and press ENTER to return to Filer. Start 1-2-3 and, if necessary, save any work in progress and issue the command Menu, Worksheet, Erase, Yes. Then use the command Menu, File, Import, Text. Press the ESC key to get rid of the directory name at the end of the prompt and type in C:\_DAT\FILES.PRN and press Enter. You should see the list of files appear in the spreadsheet. Note that each line in the listing is a string of characters contained in the cells in column A. To sort the list, we have to break up the strings and put the file names, extensions, sizes, dates and times in separate columns. This is where the "data parsing command" comes in handy. First, we want to get rid of the lines at the top and the bottom of the list. Do this with the command Menu, Worksheet, Delete, Rows and highlight the rows at the top of the list down to the first line that contains a file name. Go to the bottom of the list and use the same command and erase the line that contains the number of files and the bytes-free-line. Go to the top of the list and use the command Menu, Data Parse, Format-Line, Create. A dialog box will cover the first few lines in the display. To see what has happened, press Format-Line, Edit and the dialog box will disappear. You'll see a line that looks like this L>>>>****V>>******V>>>*L>>>>>>>**L>>>>> The letters V (value) and L (label) will be lined up over the columns of data. Press Input-Column, period, Fn+RightArrow, DownArrow to highlight all the rows in column A and press ENTER. Press Output Range and move the cursor to cell F2 and press ENTER. Press Go and see what happens. All the lines in the list will be "parsed", i.e., separated into individual fields. Now we can proceed to sort the data any way we want. Here's how to perform the sort. Use the command Menu, Data, Sort, Data-Range (A2.. Jxx) where "xx" is the last row that contains data in column J. Press Primary-Key and move the cursor to cell G2 and press ENTER. Type A for Ascending and press ENTER. Press Secondary-Key and move to cell H2 and press ENTER. Leave the Sort Order as D and press ENTER. Finally press Go and you'll find that the list has been sorted by extension and then by size (in descending order). The original list in column A will also have been sorted to match the parsed list.
|
|
Copyright © 2005 Thaddeus Computing Inc
<