Hola Foro, quería saber como hacer para eliminar las comillas que se generan cuando hago un Copy To &NomArch DELIMITED WITH ";" SDF
Al hacer este ejemplo me coloca comillas entre _ y una , en vez de ;
por ejemplo:
"06","2017","95003","C.A.M. MARIA MAGDALENA","2","18176422","27181764223"
"06","2017","95003","C.A.M. MARIA MAGDALENA","2","22242013","20222420130"
En cambio si pongo solo Copy To &NomArch SDF
me los genera de la siguiente manera:
06201795080COLEGIO MEDALLA MILAGROSA 22813972027281397201
06201795080COLEGIO MEDALLA MILAGROSA 22891772220289177222
Gracias
Copy File SDF eliminar comillas
- armando.lagunas
- Posts: 340
- Joined: Mon Oct 05, 2009 3:35 pm
- Location: Curico-Chile
- Contact:
Re: Copy File SDF eliminar comillas
Hola, extracto de la ayuda de Xharbour sobre este comando.
trata de usarla de esta forma, para saber como resulta
Copy To &NomArch SDF DELIMITED WITH ( {"," chr(59)} )
** chr(59) = ";"
espero que sirva
un punto importante que dice que la calusula DELIMITED debe ser la ultima en usarse
DELIMITED
The DELIMETED option specifies the target file as a delimited ASCII file where field values are separated with a comma and Character values are enclosed with a delimiting character. The default delimiter for Character values is a double quotation mark.
DELIMITED WITH BLANK | TAB | PIPE
When the delimiter is specified as BLANK, field values in the new created ASCII text file are separated by one space and character fields are not enclosed in delimiters. Alternatively, the delimiting character between field values can be specified as TAB (Chr(9)) or PIPE (Chr(124)).
DELIMITED WITH <xDelimiter>
The WITH option specifies the delimiting character to enclose values of Character fields in. <xDelimiter> can be specified as a literal character or a character expression enclosed in parentheses. <xDelimiter> can also be specified as an array with two elements: { <cCharacterDelimiter>, <cFieldDelimiter> }. If this option is used, the array must be enclosed in parentheses. It defines the delimiting characters for field values of type "C" and the delimiters between field values.
Important: If the DELIMITED WITH option is used in the COPY TO command, it must be placed as the last option in the command.
// The example creates different delimited ASCII files.
PROCEDURE Main
USE Address NEW
// Creates a regular DELIMITED ASCII file
COPY TO Test.txt DELIMITED
// Uses Chr(9) as field delimiter
COPY TO Test1.txt DELIMITED WITH TAB
// Uses "|" as field delimiter
COPY TO Test2.txt DELIMITED WITH PIPE
// Encloses character values in single quotes and separates
// fields with Chr(255)
COPY TO Test3.txt DELIMITED WITH ( {"'", Chr(255) } )
USE
RETURN
trata de usarla de esta forma, para saber como resulta
Copy To &NomArch SDF DELIMITED WITH ( {"," chr(59)} )
** chr(59) = ";"
espero que sirva
Re: Copy File SDF eliminar comillas
Gracias por contestar pero no puede obtener el resultado deseado con esa sentencia así que hice una cochinada pero con eso logre lo que quería, cree un campo adicional entre cada uno de _ que tenia la base y le asigne el caracter ;