i have a db set up on sun OS
And my local machine in which the client xists is NT
Now everytime we get a ascii file with data....throgh FTP ...and it is stored in a dir in the db server....
And I run a script to upload this data into db using sql plus on my NT machine..
The problem is that...the data file when it reaches to my place has a ^M character as suffix for all lines...
Which is seen only If i go directly on to the server and open the file...
and not whn i open the file in my NT env..
is there a possibel was that when i open the file for read to load data through my plsql..i can check if this ^M char xists and yes..i can just omit it?
I hope i am clear enuff
The easiest thing to do is to convert the file.. If you use A utility like PFE (Programmers file editor), open the file, choose save-as and select unix-format. The ^M's will dissapear.
Failing that, you could do a pre-ckeck using plsql - open the file using UTL_FILE, read each line checking for instr(line, '^M') <>0.
Incorrect FTP mode
As pointed out by Pipo,
Use the right FTP mode to transfer files - Binary or Ascii
A farmer learns more from a bad harvest than a good one
It is the didfference in the OS. Use the Solaris utils, dos2unix and unix2dos to convert files for the proper OS.
the easiest thing to do is to use binary ftp (just type bin under your ftop prompt)
you also can use a sed or use a simple regular expression under vi :
(note : you get ^M by doing Ctrl-V, then enter)
Click Here to Expand Forum to Full Width