home *** CD-ROM | disk | FTP | other *** search
- ;C
- ┌─────────────────────────────────────────────────────────────────────────────┐
- │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ EXAMPLE # 7 ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ │
- └─────────────────────────────────────────────────────────────────────────────┘
- ┌─────────────────────────────────────────────────────────────────────────────┐
- │ │
- │ THE INPUT FILE: A list of products available from Pinnacle Software. The │
- │ data has been put into columns using the tab (ASCII 09) │
- │ character. If the tab width is 2 characters, the two columns of data line │
- │ up nicely at positions 1 and 23. When you look at the input, you'll notice │
- │ that our little file viewer shows these characters as small circles, since │
- │ that is what the IBM character set uses for ASCII 09. Most word processors │
- │ convert ASCII 09 to a tab, though they do not always use the same spacing │
- │ (i.e. some treat ASCII 09 like 3 spaces while some treat it like 8.) │
- │ │
- │ WHAT WE WANT: Replace each tab character with two spaces, so the data is │
- │ in neat columns and we convert it to comma-delimited format. │
- │ │
- │ HOW WE DO IT: (1) We use CHANGE to change each tab to two spaces. │
- │ (2) We use SET to extract the columns. │
- │ (3) We use TRIM to remove excess spaces. │
- │ │
- └─────────────────────────────────────────────────────────────────────────────┘
-
- ;P
-