#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default ftp to Unix

I am transferring data from a s/s to a Unix server using the 'save in'
feature Add/Modify FTP Location, but each line has ^M at the end of it. This
is normally caused by the transfer protocol. Is this set in Microsoft or the
Unix server?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default ftp to Unix

The ^M in dicates there is both a Carriage Retiurn and line feed at the end
of a line. Windows puts both the line feed and CR in the file while Unix
only has CR. On most UNIX machines there are two commands unix2dos and
dos2unix. Running dos2unix filename newfilename will fix the problem.

"ng42" wrote:

I am transferring data from a s/s to a Unix server using the 'save in'
feature Add/Modify FTP Location, but each line has ^M at the end of it. This
is normally caused by the transfer protocol. Is this set in Microsoft or the
Unix server?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default ftp to Unix

With FTP diod you set it for Ascii or binary. try using Ascii transfer, this
will probably remove the Linefeed.

Other methods are to use VI editor and removve last character in each row.

vi filename

type colon (:) to get in command mode. Then type the following

1,$s/.$//

1,$ is the address for doing every line in the file. $ is ast line in the
file

s/.$// the $ in this case is end of line. .$ is the last charactter on the
line. s is the substitute command. Replaces last character on the line with
nothing.


You can also make a script using the SED editor. I don't remmber this sytax.
"ng42" wrote:

I am transferring data from a s/s to a Unix server using the 'save in'
feature Add/Modify FTP Location, but each line has ^M at the end of it. This
is normally caused by the transfer protocol. Is this set in Microsoft or the
Unix server?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default ftp to Unix

Hi Joel
Thanks for response. Is this a command that would have to be applied to
every file transferred or can it be incorporated into a general setting. I
will have multiple users saving many files so ideally it needs to be a
setting. What is interesting is other clients of mine can do exactly this,
i.e. save from Excel direct to the Unix server and the file remains true i.e.
no ^M to be seen anywhere. What we cannot work out is what is different
between the 2 organisations i.e. why it works there but fails here.

"Joel" wrote:

The ^M in dicates there is both a Carriage Retiurn and line feed at the end
of a line. Windows puts both the line feed and CR in the file while Unix
only has CR. On most UNIX machines there are two commands unix2dos and
dos2unix. Running dos2unix filename newfilename will fix the problem.

"ng42" wrote:

I am transferring data from a s/s to a Unix server using the 'save in'
feature Add/Modify FTP Location, but each line has ^M at the end of it. This
is normally caused by the transfer protocol. Is this set in Microsoft or the
Unix server?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect PC to UNIX via TCP/IP [email protected] Links and Linking in Excel 0 January 20th 07 09:34 PM
Unix to Excel question maryj Excel Discussion (Misc queries) 0 April 10th 06 03:54 PM
Unix Time Function jnorton Excel Worksheet Functions 2 May 24th 05 06:04 PM
Excel and Unix Question Jet Excel Worksheet Functions 0 March 22nd 05 11:58 AM
Unix Time in Excel Craig Walker Excel Worksheet Functions 2 March 21st 05 06:29 PM


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"