Kbase 16376: How to use quoter with TAB delimited data files DOS example
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to use quoter with TAB delimited data files DOS example
How to use quoter with TAB delimiters -- DOS or Windows
--------------------------------------------------------
The following line of code run from the 4gl works in the UNIX
environment:
UNIX VALUE ('quoter -d "' + chr (9) + '" cust-tab.d > cust-quoted.d')
The same code, changed to use os-command in DOS or WINDOWS, results in
the following error because the TAB is getting converted to SPACES:
'the -d option should be followed by a space and then a single char..'
You can work around this problem by writing a .bat file to run quoter
and calling that .bat file from the OS-COMMAND in the 4gl.
Here is an example:
/* testq.bat */
/* make sure there's a real tab character between the quotes */
quoter -d " " %1 >%2
/* testq.p */
def var infile as char init "testq.txt".
def var outfile as char init "testq.out".
os-command silent value("testq.bat " + infile + " " + outfile).
Progress Software Technical Support Note # 16376