473,396 Members | 1,982 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,396 software developers and data experts.

Generating BCP input file from Perl/Unix

Hi,

I am attempting to process a proprietary formatted file into flat csv
for the purpose of bcp'ing into a SQL Server 2005 install. I tried
writing a processor in Perl that "works" except that the BCP tool in
windows just does not like the file, it gives me the "Unexpected
EOF...." error that is usually associated with misaligned fields.

I am pretty sure the cause of this is the end of line character
differences between platforms. I did some tests with a single row
manually inserted and bcp'd out of the SQL Server using csv format,
and the formatting looks identical to my perl output file. When I get
the hex editor involved, I can see the bcp output has 2 characters at
the end of each line (LF and CR if I am correct) whereas the unix
output has only 1.

I have been unable to get the perl script to output the right eol
characters for BCP to work.

I wrote another processor in C# under windows that works perfectly.

Is there a solution in perl? how do I terminate the lines properly? is
there a way to get BCP to recognize and accept different eol
characters?

Any advice is appreciated.

Thanks.
Dec 11 '07 #1
0 3146

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Xah Lee | last post by:
Just bumped into another irresponsibility in perl. the crime in question this time is the module File::Basename. Reproduction: 1. create a directory containing a file of this name:...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
8
by: shandra | last post by:
I have a file I need to delete or truncate. I tried using the KILL command in VB6. I tried using the file.delete command in VB.net. I tried manually deleting, renaming, and copying over the...
6
by: Intiha | last post by:
Hello all, I am trying to generate random seeds for my simulations. currently i was using srand(time(NULL); for this purpose. But for confidence in my results i ran it using a script in a loop....
8
by: jaynemarie | last post by:
I am new to using Active State Perl, I've use Perl on Linux and Unix systems and the same thing on unix systems don't work with active state and I am perplexed. I wrote the code below and I am...
4
by: jane007 | last post by:
Hello everybody: I am having a problem. On Unix platform, there is a script that need user to input data from console, then when I call Unix perl script from Windows, these is an issue occurs,...
1
by: georgewa | last post by:
Greetings all, great forum, this is my first post. Recently trying to write a script that is designed to move files based on timestamps. I am fairly new to Perl, so please bare with me. I have...
223
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX...
8
by: Richard | last post by:
"Bill Cunningham" <nospam@nspam.invalidwrites: By stdc do you mean "standard c" Bill? I think you should ask in c.l.c : they are always willing to help people with their parsers and 128...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.