home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 21
/
CD_ASCQ_21_040595.iso
/
dos
/
tools
/
par271
/
example7.inf
< prev
next >
Wrap
Text File
|
1995-03-06
|
2KB
|
26 lines
===============================================================================
========================== ============================
========================== EXAMPLE # 7 ============================
========================== ============================
===============================================================================
THE INPUT FILE: A list of products available from Pinnacle Software. In this
list, 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 spaces).
WHAT WE WANT: Replace each tab character with two spaces. Once the data is
in neat columns, we can convert it to comma-delimited format.
HOW WE DO IT: (1) We use CHANGE to change each tab character to two spaces.
(2) We use SET to extract the columns.
(3) We use TRIM to remove excess spaces.