converting LF to CR-LF

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Scott B

converting LF to CR-LF

Post by Scott B »

Is there a way (preferences?) to convert a lines ending with a LF to lines ending with CR-LF? I think some files got sent to an ftp site incorrectly. Textpad displays the files as if the lines ended with CR-LF but they really only end in CR. I know that the Visual C++ editor will correct the ending characters.

Scott
Darren

Re: converting LF to CR-LF

Post by Darren »

Perform a Save-As and change the file format to PC. The file will be saved with CRLF. If you want LF only, then save as UNIX.
Scott B

Re: converting LF to CR-LF

Post by Scott B »

Thanks for the reply, Darren.

The order of events was to bring the file over from whatever the ftp site is (I don't know if its Unix or not), then edit the file with Textpad with the PC option already set. I am running Textpad on a Windows 2000 system. So, how does this information change the solution? Thanks for your input.

Scott
Andreas

Re: converting LF to CR-LF

Post by Andreas »

if you transfer by ftp, make sure to transfer in ASCII mode.
Line end conversion should then take place during ftp transfer.
Scott B

Re: converting LF to CR-LF

Post by Scott B »

Andreas, thanks for the reply. I understand using ftp for text and binary transfers. Unfortunately, I'm not sure why the file arrived incorrectly. Its something that I haven't had time to research. (I use WebDrive from my W2K machine and do have it set to do text transfers. That didn't stop the file from being incorrect, though.) Because the files are now on my machine, I need to know if Textpad can do the conversion. If not, perhaps it should be added to the enhancement list.

Scott
Brett Norris

Re: converting LF to CR-LF

Post by Brett Norris »

Try this:

1. Open the affected file in TextPad
2. Press ALT-ENTER, "File type" will display PC, UNIX, or Unknown.
3. If it's not PC, then press Cancel -> File menu -> Save As
4. Select the desired file type (PC) in the "File format" drop down list (located towards the bottom of the Save As dialog window).
5. Save as a new file, or overwrite the original.
6. Press ALT-ENTER, "File type" will display PC (which is CR-LF).

Brett.
Post Reply