Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 276

AmigaWorld Official AmigaDOS 2 Companion

The FILE/M argument consists of any number of files or file patterns that you wish to combine into one large file. None of the input files are changed by joining them. The AS=TO/K/A argument is the name of the combined file. It can't be the name of one of the input files. For example, to combine all the script files in your S: directory into one file named all_scripts, you enter:

JOINS:*? AS adscripts You can combine all types of files — programs, data files, icon files, and so on — with Join, but most of the time you will use Join to combine text files. For example, if you've used Dir with the ALL option to create files that list the contents of every disk you own, you can create a master file of the contents of all your disks by using the Join command.

Sort: Sorting Text Files Let's say you captured a list of all the files in your Sys:System directory by entering:

LIST >files.list Sys:System NOHEAD When you type the file, you get the output shown in Figure 9-6, accurate but unorganized. To sort the filenames in alphabetical order, you enter:

SORT files.list TO sorted.list

When you type sorted.list, you'll see that its contents are alphabetized (see Figure 9-7) thanks to the Sort command, which sorts the lines of a text file. Its template is: FROM/A,TO/A,COLSTART/K,CASE/S,NUMERIC/S

The FROM/A argument names the file you want to sort, while TO/A identi fies the sorted file produced by the command. Note that the two files can be the same.

The COLSTART/K argument specifies the first character of the key to the sort. A sort key is the character or group of characters in each line that the Sort command tests to determine where each line should appear in the sorted out put. If necessary, the Sort command will use the entire line as a sort key. By default, the key to a sort begins with the first character on each line. You can change the beginning character of the key with the COLSTART/K argument. For example, if you sort the files.list with a different COLSTART/K, you get different results. Enter the following: SORT files.list TO newsort.list COLSTART 2


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.