Feature Request

oraclelover

Member²
I often save my source onto a unix box. In doing this I end up with ^M at the end of each line. Is there anyway to save in a Unix format that will get rid of this type of control text? I can fix this issue using vi, however I'm a lazy developer and like to automate anything I can and if I can keep this ability within PL/SQL Developer that would be a huge plus.

Here is an overview which you probably know.

Description
UNIX treats the end of line differently than other operating systems. Sometimes when editing files in both Windows and UNIX environments, a CTRL-M character is visibly displayed at the end of each line as ^M in vi.

Directions to fix issue in vi
To remove the ^M characters at the end of all lines in vi, use:

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:

:%s/^M//g

In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).

Thanks
 
use the ftp plugin, that does the conversion for you.

i have bound shift-ctrl-o for open, the regular ctrl-s works for save, and to save as, shift-ctrl-s.

it is as quick as a normal open and save once you get used to it.
 
Thanks for the info rbrooker. I will look into doing that. For me this should work, but for someone else if there unix box by chance doesn't have ftp or doesn't allow them to connect vi ftp they will be out of luck.
 
If you don't want to use the ftp plugin for whatever reason, just make sure that you ftp your file in ascii mode and not binary when you send your file to the UNIX box.

There should be an option if you use a Windows ftp program. If you use the command line, just type "ascii" when the ftp session is open.
 
That works great, but that still assumes everyone has ftp access. I happen to have ftp access not sure if 100% of people will though. Plus why should I have to ftp some files and save other files normally? Seems not to be that clean of a process if I have to use one process vs the other to save my files. That's why if the pl/sql developer could have an option to save in unix format that would be nice. Seems like it would be fairly easy. I would attempt a plugin but C++ really is not my cup of tea with the small amount of time I have free.

I should mention that I'm using Samba so I have access to unix directories from my windows machine. That is I have drive letters mapped to unix file server. So I can save directly from pl/sql developer to the unix box. Which makes ftp to not be needed for me.
 
Back
Top