home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _D755AA6B4693467495914E3CFBDE5E70 < prev    next >
Text File  |  2003-03-07  |  15KB  |  514 lines

  1. Sorting text and data
  2.  
  3. You can sort text and data in a current document or in a file on disk to organize information in a variety of ways.
  4.  
  5. In this section, you'll learn about
  6.  
  7.   sorting
  8.   
  9.   working with records
  10.   
  11.   working with sort keys
  12.   
  13.   creating and modifying sort definitions
  14.   
  15. You can use sort operators to define the expression for a sort. For information about sort operators, see "Sort operators."
  16.  
  17. Sorting
  18.  
  19. You can sort text by using the predefined sort definitions included in WordPerfect. The sorted text can be displayed on-screen or saved to a file.
  20.  
  21. By using sort definitions, you can sort text alphabetically or numerically. For example, you can alphabetize a word list, sort a table of students according to their grades, or create a chronological list of purchase dates. You can also set sort options to be able to undo a sort or to sort uppercase words before lowercase words.
  22.  
  23. You can sort by date. You can also sort items in reverse order so that the last displays first.
  24.  
  25. To sort text
  26.  
  27. 1    Click Tools  Sort.
  28.  
  29. 2    Click File to sort, and click a file.
  30.  
  31. 3    Click Output to, and click a file.
  32.  
  33. 4    From the Sort by list, choose one of the following:
  34.  
  35.   First word in a paragraph-where each paragraph record ends with two or more hard returns
  36.   
  37.   First word in a merge data fiIe-where each merge record ends with an ENDRECORD code
  38.   
  39.   First cell in a table row-where each record is a row of cells
  40.   
  41.   First word in a parallel column-where each record is a table column or parallel column
  42.   
  43.   First word in a line-where each line record ends with a hard return
  44.   
  45.   Date in a line-where each record ends with a hard return
  46.   
  47.   Date in a table row-where each record is a row of cells
  48.   
  49. Tip
  50.  
  51.   You can sort only part of a document by selecting the text you want to sort.
  52.   
  53. To sort text alphabetically or numerically
  54.  
  55. 1    Click Tools  Sort.
  56.  
  57. 2    Click File to sort, and click a file.
  58.  
  59. 3    Click Output to, and click a file.
  60.  
  61. 4    Click New.
  62.  
  63. 5    In the New sort dialog box, type a name in the Sort description box.
  64.  
  65. 6    In the Sort by area, enable one of the following options:
  66.  
  67.   Line (ends with one hard return)-sorts by line
  68.   
  69.   Paragraph (ends with multiple hard returns)-sorts by paragraph
  70.   
  71.   Merge record-sorts by merge record
  72.   
  73.   Table row-sorts by table row
  74.   
  75.   Parallel column row-sorts by table column or parallel column
  76.   
  77.   Date-sorts by date
  78.   
  79. 7    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  80.  
  81.   Alpha
  82.   
  83.   Numeric
  84.   
  85. 8    Choose one of the following from the Sort order list box:
  86.  
  87.   Ascending-sorts from first to last or smallest to largest
  88.   
  89.   Descending-sorts from last to first or largest to smallest 
  90.   
  91. Tip
  92.  
  93.   You can sort only part of a document by selecting the text you want to sort.
  94.   
  95. To set sort options
  96.  
  97. 1    Click Tools  Sort.
  98.  
  99. 2    Click Options, and click one of the following:
  100.  
  101.   Allow undo after sorting
  102.   
  103.   Uppercase sorts before lowercase.
  104.   
  105. A check mark next to the command indicates that the command is enabled.
  106.  
  107. To sort dates
  108.  
  109. 1    Click Tools  Sort.
  110.  
  111. 2    Click File to sort, and click a file.
  112.  
  113. 3    Click Output to, and click where you want to output the sorted text.
  114.  
  115. 4    Click New.
  116.  
  117. 5    In the New sort dialog box, type a name in the Sort description box.
  118.  
  119. 6    In the Sort by area, enable the Line (ends with one hard return) option.
  120.  
  121. 7    In the Keys (sorting rules) area, choose Date from the Type list box.
  122.  
  123. 8    Choose one of the following from the Sort order list box:
  124.  
  125.   Ascending-sorts from smallest to largest or first to last (1 to 9)
  126.   
  127.   Descending-sorts from largest to smallest or last to first (9 to 1)
  128.   
  129. Notes
  130.  
  131.   You must define a sort key for each part of the date you want to sort. For information about defining a sort key, see "Working with sort keys."
  132.   
  133.   When you enter a date, use forward slashes ( / ) or dashes ( - ) to separate the numbers in a date (for example, 12/25/59). WordPerfect interprets the date 12/25/59 as one word.
  134.   
  135. To sort by the last item in a list
  136.  
  137. 1    Click Tools  Sort.
  138.  
  139. 2    Do any of the following:
  140.  
  141.   Click File to sort and choose a file.
  142.   
  143.   Click Output to and choose where you want to output the sorted text.
  144.   
  145. 3    Click New.
  146.  
  147. 4    In the New sort dialog box, type a name in the Sort description box.
  148.  
  149. 5    In the Sort by area, enable one of the following options:
  150.  
  151.   Line (ends with one hard return)-sorts by line
  152.   
  153.   Paragraph (ends with multiple hard returns)-sorts by paragraph
  154.   
  155.   Merge record-sorts by merge record
  156.   
  157.   Table row-sorts by table row
  158.   
  159.   Parallel column row-sorts by table column or parallel column
  160.   
  161.   Date-sorts by date
  162.   
  163. 6    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  164.  
  165.   Alpha-sorts in alphanumeric order by letters and then by numbers
  166.   
  167.   Numeric-sorts by numbers only
  168.   
  169.   Date-sorts by date
  170.   
  171. 7    In the Keys (sorting rules) area, choose one of the following from the Sort order list box:
  172.  
  173.   Ascending-sorts from smallest to largest order or first to last (1 to 9)
  174.   
  175.   Descending-sorts from largest to smallest order or last to first (9 to 1)
  176.   
  177. 8    In the Keys (sorting rules) area, tab to the record subdivision boxes and type a value in one of the following boxes that corresponds to the part of the record you want to sort:
  178.  
  179.   Line
  180.   
  181.   Field
  182.   
  183.   Word
  184.   
  185.   Column
  186.   
  187. Working with records
  188.  
  189. You can sort records that meet certain criteria by using sort operators and sort keys. Sorting this way limits a sort to only the information you want.
  190.  
  191. When you combine sort operators and parameters, you create expressions (selection statements). For example, specifying "Smith" and "Nevada" lets you select only records that contain both words. For more information about using sort operators, see "Sort operators."
  192.  
  193. Each record contains the same categories of information, such as names with addresses, items in inventory, or client data. Text is divided into records, and records are subdivided into lines, words, fields, or columns depending on the text format. The subdivisions can be used to set criteria for the sort. The way records are divided depends on how the record is formatted, for example, in a table or in paragraphs.
  194.  
  195. You can also extract records without sorting them. Extracting records allows you to collect the data you need and leave them in their original order.
  196.  
  197. To extract records without sorting
  198.  
  199. 1    Click Tools  Sort.
  200.  
  201. 2    Click File to sort and choose a file.
  202.  
  203. 3    Click New.
  204.  
  205. 4    In the New sort dialog box, type a name in the Sort description box.
  206.  
  207. 5    In the Keys (sorting rules) area, tab to the record subdivision boxes and type a value in one of the following boxes that corresponds to the part of the record you want to sort:
  208.  
  209.   Line
  210.   
  211.   Field
  212.   
  213.   Word
  214.   
  215.   Column
  216.   
  217. If you want to define other sort criteria, type an expression in the Extract records box.
  218.  
  219. 6    Enable the Extract records without sorting check box.
  220.  
  221. To specify sort criteria
  222.  
  223. 1    Click Tools  Sort.
  224.  
  225. 2    Click New.
  226.  
  227. 3    In the New sort dialog box, type a name in the Sort description box.
  228.  
  229. 4    In the Sort by area, enable one of the following options:
  230.  
  231.   Line (ends with one hard return)-sorts by line
  232.   
  233.   Paragraph (ends with multiple hard returns)-sorts by paragraph
  234.   
  235.   Merge record-sorts by merge record
  236.   
  237.   Table row-sorts by table row
  238.   
  239.   Parallel column row-sorts by table column or parallel column
  240.   
  241.   Date-sorts by date
  242.   
  243. 5    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  244.  
  245.   Alpha-sorts in alphanumeric order by letter and then by number
  246.   
  247.   Numeric-sorts by number only
  248.   
  249.   Date-sorts by date
  250.   
  251. 6    Choose one of the following from the Sort order list box:
  252.  
  253.   Ascending-sorts from smallest to largest or first to last
  254.   
  255.   Descending-sorts from largest to smallest or last to first
  256.   
  257. 7    Tab to the record subdivision boxes and type a value in any of the following boxes:
  258.  
  259.   Line
  260.   
  261.   Field
  262.   
  263.   Word
  264.   
  265.   Column
  266.   
  267. If you want to further define a sort, type selection statements in the Extract records box.
  268.  
  269. Notes
  270.  
  271.   When you extract records, the original file remains unchanged; the output file contains only the records you specified.
  272.   
  273.   Key 1 is sorted first, Key 2 is sorted next, and so on.
  274.   
  275. Tips
  276.  
  277.   You can also use parentheses to group parts of a selection statement.
  278.   
  279.   You can sort only part of a document by selecting the text you want to sort.
  280.   
  281. Working with sort keys
  282.  
  283. You can add a sort key (or rule) to define how you want information sorted. You define the sort keys, and use them to specify which part of the record to sort and the order of the sort. The sort keys are applied in numerical order.
  284.  
  285. You can also edit a sort key definition, and delete a sort key.
  286.  
  287. To add a sort key
  288.  
  289. 1    Click Tools  Sort.
  290.  
  291. 2    Choose a sort definition from the Sort by list box.
  292.  
  293. 3    Click Edit.
  294.  
  295. 4    In the Keys (sorting rules) area, click a key.
  296.  
  297. 5    In the Keys (sorting rules) area, click one of the following:
  298.  
  299.   Add Key at end-adds a key to the end of the key list
  300.   
  301.   Insert Key between-adds a key above the row in which the cursor is positioned
  302.   
  303. Note
  304.  
  305.   You can add up to nine sort keys.
  306.   
  307. To edit a sort key definition
  308.  
  309. 1    Click Tools  Sort.
  310.  
  311. 2    From the Sort by list box, choose a sort definition.
  312.  
  313. 3    Click Edit.
  314.  
  315. 4    In the Keys (sorting rules) area, click a key.
  316.  
  317. 5    Modify any settings.
  318.  
  319. 6    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  320.  
  321.   Alpha-sorts in alphanumeric order by letters and then by numbers
  322.   
  323.   Numeric-sorts by numbers only
  324.   
  325.   Date-sorts by date
  326.   
  327. 7    In the Keys (sorting rules) area, choose one of the following from the Sort order list box:
  328.  
  329.   Ascending-sorts from smallest to largest order or first to last (1 to 9)
  330.   
  331.   Descending-sorts from largest to smallest order or last to first (9 to 1)
  332.   
  333. 8    In the Keys (sorting rules) area, tab to the record subdivision boxes and type a value in one of the following boxes that corresponds to the part of the record you want to sort:
  334.  
  335.   Line
  336.   
  337.   Field
  338.   
  339.   Word
  340.   
  341. To delete a sort key
  342.  
  343. 1    Click Tools  Sort.
  344.  
  345. 2    From the Sort by list box, choose a sort definition.
  346.  
  347. 3    Click Edit.
  348.  
  349. 4    Click a key.
  350.  
  351. 5    Click Delete key.
  352.  
  353. Creating and modifying sort definitions
  354.  
  355. You can create a new sort definition, and you can edit, copy, or delete an existing sort definition.
  356.  
  357. When you define sort keys you are creating a sort definition. Sort keys (or rules) can define how you want information sorted. Sort keys determine which part of the record to sort and the order of the sort. The sort keys are applied in numerical order.
  358.  
  359. To create a sort definition
  360.  
  361. 1    Click Tools  Sort.
  362.  
  363. 2    Click New.
  364.  
  365. 3    In the Sort description box type a name.
  366.  
  367. 4    In the Sort by area, enable one of the following options:
  368.  
  369.   Line (ends with one hard return)-sorts by line
  370.   
  371.   Paragraph (ends with multiple hard returns)-sorts by paragraph
  372.   
  373.   Merge record-sorts by merge record
  374.   
  375.   Table row-sorts by table row
  376.   
  377.   Parallel column row-sorts by table column or parallel column
  378.   
  379.   Date-sorts by date
  380.   
  381. 5    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  382.  
  383.   Alpha-sorts in alphanumeric order by letters and then by numbers
  384.   
  385.   Numeric-sorts by numbers only
  386.   
  387.   Date-sorts by date
  388.   
  389. 6    In the Keys (sorting rules) area, choose one of the following from the Sort order list box:
  390.  
  391.   Ascending-sorts from smallest to largest order or first to last (1 to 9)
  392.   
  393.   Descending-sorts from largest to smallest order or last to first (9 to 1)
  394.   
  395. 7    In the Keys (sorting rules) area, tab to the record subdivision boxes and type a value in one of the following boxes that corresponds to the part of the record you want to sort:
  396.  
  397.   Line
  398.   
  399.   Field
  400.   
  401.   Word
  402.   
  403.   Column
  404.   
  405. Notes
  406.  
  407.   When you create a new sort definition, it is saved in the Sort by list box.
  408.   
  409.   You can customize a sort by using sort keys. For information about sort keys, see "Working with sort keys."
  410.   
  411. To edit a sort definition
  412.  
  413. 1    Click Tools  Sort.
  414.  
  415. 2    From the Sort by list box, choose a sort definition.
  416.  
  417. 3    Click Edit.
  418.  
  419. 4    In the Sort description box, type a new name.
  420.  
  421. 5    Modify any settings.
  422.  
  423. 6    In the Sort by area, enable one of the following options:
  424.  
  425.   Line (ends with one hard return)-sorts by line
  426.   
  427.   Paragraph (ends with multiple hard returns)-sorts by paragraph
  428.   
  429.   Merge record-sorts by merge record
  430.   
  431.   Table row-sorts by table row
  432.   
  433.   Parallel column row-sorts by table column or parallel column
  434.   
  435.   Date-sorts by date
  436.   
  437. 7    In the Keys (sorting rules) area, choose one of the following from the Type list box:
  438.  
  439.   Alpha-sorts in alphanumeric order by letters and then by numbers
  440.   
  441.   Numeric-sorts by numbers only
  442.   
  443.   Date-sorts by date
  444.   
  445. 8    In the Keys (sorting rules) area, choose one of the following from the Sort order list box:
  446.  
  447.   Ascending-sorts from smallest to largest order or first to last (1 to 9)
  448.   
  449.   Descending-sorts from largest to smallest order or last to first (9 to 1)
  450.   
  451. 9    In the Keys (sorting rules) area, tab to the record subdivision boxes and type a value in one of the following boxes that corresponds to the part of the record you want to sort:
  452.  
  453.   Line
  454.   
  455.   Field
  456.   
  457.   Word
  458.   
  459. To copy a sort definition
  460.  
  461. 1    Click Tools  Sort.
  462.  
  463. 2    From the Sort by list box, choose a sort definition.
  464.  
  465. 3    Click Copy.
  466.  
  467. 4    In the Sort description box, type a new name.
  468.  
  469. To delete a sort definition
  470.  
  471. 1    Click Tools  Sort.
  472.  
  473. 2    From the Sort by list box, choose a sort definition.
  474.  
  475. 3    Click Delete.
  476.  
  477. Reference: Sorting text and data
  478.  
  479. A sort operator is a symbol that instructs the soft to perform an action in an expression (selection statement). For example, the expression, key1=red & key3>5, extracts only the records where the information in the first sort key is red and the information in the third sort key is greater than five. When you define a sort definition, you can use sort operators.
  480.  
  481. Sort operators
  482.  
  483. When you define the criteria for a sort definition, you can use the sort operators listed in the following table.
  484.  
  485. Symbol    What It Does
  486.  
  487. |    Selects records that meet the conditions of either key.
  488.  
  489. &     Selects records that meet the conditions of both keys.
  490.  
  491. =     Selects records that have the same information in an indicated key.
  492.  
  493. <>     Selects records that do not match the information for an indicated key.
  494.  
  495. >    Selects records that have information greater than the information for an indicated key.
  496.  
  497. <    Selects records that have information less than the information for an indicated key.
  498.  
  499. >=    Selects records that have information greater than or equal to the information for an indicated key.
  500.  
  501. <=    Selects records that have information less than or equal to the information for an indicated key.
  502.  
  503. key g    Selects records that contain the word you specify anywhere in the record (global search).
  504.  
  505. Notes
  506.  
  507.   Each line of text is a field that can be divided into two or more fields using tabs and indents.
  508.   
  509.   In merge records, fields end with the ENDFIELD code. 
  510.   
  511.  
  512.  
  513.  
  514.