473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

No field delimiters using bcp command

Hi,

I am using a bcp command to load data into a text file . The command is below:

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.tx
t -c -U sax -S KARAFOKAS -C 1252 -P passsax

The command runs fine , the problem is , the output in the text file is with tab delimited form. I want the format NOT to have tab delimited form but the values actually to have a continuation. That is, nothing to split one value from the other.

This is the output with tab delimited format.

vvvXXXXXXXXXXXXXXXXXXXXXX 20071112 h 0000000000005555,70 066,50000
abcXXXXXXXXXXXXXXXXXXXXXX 19000101 y 0454545454523456,45 077,30000
xyzcccXXXXXXXXXXXXXXXXXXX 19000101 x 0000000000003456,00 077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX 20030302 6 0000000000232323,45 005,00000

I want the output to have to tabs , as shown below:

vvvXXXXXXXXXXXXXXXXXXXXXX20071112h0000000000005555 ,70066,50000
abcXXXXXXXXXXXXXXXXXXXXXX19000101y0454545454523456 ,45077,30000
xyzcccXXXXXXXXXXXXXXXXXXX19000101x0000000000003456 ,00077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX2003030260000000000232323 ,45005,00000

Columns values should not be seperated by tabs. Any thoughts?



Thank you
George
Sep 24 '07 #1
1 6126
ck9663
2,878 Expert 2GB
Hi,

I am using a bcp command to load data into a text file . The command is below:

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.tx
t -c -U sax -S KARAFOKAS -C 1252 -P passsax

The command runs fine , the problem is , the output in the text file is with tab delimited form. I want the format NOT to have tab delimited form but the values actually to have a continuation. That is, nothing to split one value from the other.

This is the output with tab delimited format.

vvvXXXXXXXXXXXXXXXXXXXXXX 20071112 h 0000000000005555,70 066,50000
abcXXXXXXXXXXXXXXXXXXXXXX 19000101 y 0454545454523456,45 077,30000
xyzcccXXXXXXXXXXXXXXXXXXX 19000101 x 0000000000003456,00 077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX 20030302 6 0000000000232323,45 005,00000

I want the output to have to tabs , as shown below:

vvvXXXXXXXXXXXXXXXXXXXXXX20071112h0000000000005555 ,70066,50000
abcXXXXXXXXXXXXXXXXXXXXXX19000101y0454545454523456 ,45077,30000
xyzcccXXXXXXXXXXXXXXXXXXX19000101x0000000000003456 ,00077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX2003030260000000000232323 ,45005,00000

Columns values should not be seperated by tabs. Any thoughts?



Thank you
George
looks like you want a fixed-length output. have you tried passing -t "" ? or something like that? -t is the bcp parameter for field terminator.
Sep 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mukesh Kumar | last post by:
hi all, I have created some independent reports through crystal reports developer edition v 10 and developed a small tool in .net framework v 1.1 to view these reports through the crystal reports...
1
by: bjbounce2002 | last post by:
Hello, I am using forms with command buttons to close form or run action queries. The error messages such as "Null value in required field" or "duplicate value in primary key" are suppressed....
2
by: mei xiao | last post by:
Hi, there, I have a small web service project written in C# and compiled using visual studio.net, but how can I compile it using command line? Thank you. -May
2
by: accessjunior | last post by:
I was wondering if there is any way to close Access using command line swithes? Currently I have a batch file that calls the .mdb runs a macro and compacts, then I would like to close it. Any...
5
abdoelmasry
by: abdoelmasry | last post by:
Hey could any one tell me is there away to end any proccess using command line ?? i can get all running proccesses using command (tasklist) ThX
4
by: sirimanna | last post by:
hi, Is any one can help me to open files in my computer(for an example: some word document)using command button... i want to open file's using my vb programme..but i can't do it...can any one...
0
by: Siebbel | last post by:
Hello, I would like to install DB2 on a remote linux computer using command line. Does anybody know if that is possible? Or if not, are there possibilities to have the graphical interface on my...
1
by: 85ssp | last post by:
I am working on debugging a multithreaded network application. I have two forms. One of which is my testing form, the other is the actual user form. I need to be able to load only my testing form...
3
by: Israel | last post by:
I always wondered why the using command can only take one object. I always find that this isn't sufficient for drawing so I end up always disposing in my finally block but then I have to remember...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.