INF: Using BCP When Data Is Within Quotation MarksID: Q73182
|
This article describes how to customize the bulk copy program (BCP) format file to strip off unwanted quotation marks around the character strings in the data file.
It is possible to customize the BCP format file to strip off quotation
marks that surround character strings in the user's ASCII data file.
This process requires modifying the terminators to include a
backslash+quotation mark (\") to interpret the quotation mark as a
literal. If the first field in the data file is within quotation marks,
you must add a new line to the BCP format file to dispose of the first
quotation mark.
This example explains how to use BCP in the data file to exclude
the quotation marks:
4.0
4
1 SYBCHAR 0 12 "," 1 F_NAME
2 SYBCHAR 0 12 "," 2 L_NAME
3 SYBCHAR 0 4 "," 3 AGE
4 SYBCHAR 0 12 "\r\n" 4 BIRTH_PLACE
4.0
4+1
1 SYBCHAR 0 1 "" 0 FIRST_QUOTE <== NEW LINE
1+1 SYBCHAR 0 12 "," 1 F_NAME
2+1 ...
Data Terminator Appearance in Format File
---- ---------- --------------------------
abc","abc "," "\",\""
abc",123 ", "\","
123,"abc ," ",\""
abc" "<EOL> "\"\r\n"
4.0
5
1 SYBCHAR 0 1 "" 0 FIRST_QUOTE
2 SYBCHAR 0 12 "\",\"" 1 F_NAME
3 SYBCHAR 0 12 "\"," 2 L_NAME
4 SYBCHAR 0 4 ",\"" 3 AGE
5 SYBCHAR 0 12 "\"\r\n" 4 BIRTH_PLACE
Q132463 : INF: Using BCP When Data is in Quotation Marks
Additional query words: 4.20 quotes Windows NT
Keywords : kbtool SSrvBCP
Version : 4.2
Platform : OS/2 WINDOWS
Issue type :
Last Reviewed: March 11, 1999