Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-06-04 : 08:15:51
|
| Perry writes "I am trying to figure out how to export a text file that is partly fixed length and partly delimited by "|". I don't have trouble bcp'ing out a file that has a consistent format (all fixed or all delimited), but this is beyond me. I am using MS SQL 7 on a Windows 2000 server. I am not sure what other information might be needed to answer a question like this, so please e-mail them to me. If this has been answered somewhere already, I apalogize, but I have searched Books On-line and MS and a few SQL sites, but haven't been able to find anything.thanks" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-06-04 : 08:27:25
|
| I have to ask why you want to mix formats like this. It really doesn't make any sense, and as you are finding out, it's not easy to do. |
 |
|
|
calder
Starting Member
2 Posts |
Posted - 2002-06-04 : 10:08:55
|
| believe me I would avoid this like the plague if I could. this is needed for a new client that we will be doing CC authorizations for. the program that was provided for us, imports and exports a mixed format file. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-06-04 : 10:35:07
|
| Can you post:1. The table structures you are using;2. Some sample data;3. And the file format you must deliver |
 |
|
|
dataphile
Yak Posting Veteran
71 Posts |
Posted - 2002-06-05 : 03:02:54
|
| You need to treat the fixed part as one field and chop the delimited part up into fields as you export this file to a fixed field text file, then import the fixed field text file into whatever you want.In other words, blindly treat the source file as a |-delimited file.Then export to fixed field. Then to the destination.Delimited --> Fixed Field--> Destinationeg.field1 field2 field3|field4|field5xxxxxx xxxxxx xx|x|xxxxintofield1 field2 field3 field4 field5xxxxxx xxxxxx xx x xxxxthen into the real destination.--Always a pleasure. |
 |
|
|
calder
Starting Member
2 Posts |
Posted - 2002-06-06 : 12:57:32
|
| someone local told me the same thing and it works beautifully. all of the fixed fields are right at the beginning and it just never dawned on me to do something as simple as treat it as one field.thanks again. |
 |
|
|
|
|
|