The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
transfer file from unix to windows on same PC monika UNIX for Dummies Questions & Answers 4 05-28-2008 07:35 AM
File transfer between unix and windows viceversa mohanpadamata Windows & DOS: Issues & Discussions 3 02-18-2008 11:28 AM
File transfer between unix and windows server Tlg13team HP-UX 2 02-08-2008 10:40 AM
How to Transfer a whole Directory from unix to windows using FTP? ramkumarm83 IP Networking 1 12-03-2006 12:32 PM
Trying to transfer b/w Unix and Windows dirtysparks UNIX for Dummies Questions & Answers 6 09-23-2003 02:59 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-27-2009
Nandagopal Nandagopal is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 10
Question file transfer from windows to unix using ftp

Hi all,

I have a file in windows, example
a.txt
****
aaa
bbb
ccc
<empty line>

when i transfer this file to unix using ftp, and viewed the file
# vi a.txt
aaa
bbb
ccc
#
I dont get the empty line which i specified in that file in windows.
Please help me, which in unix environment, empty line feed is not supporting.

Regards
NG
  #2 (permalink)  
Old 05-27-2009
amitranjansahu's Avatar
amitranjansahu amitranjansahu is offline
Registered User
  
 

Join Date: Jan 2009
Location: Gurgaon,INDIA
Posts: 239
Try to transfer the file in ascii mode
  #3 (permalink)  
Old 05-27-2009
Nandagopal Nandagopal is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 10
I tried using ASCII mode. But even though I'm not able to get that blank line

If we give two blank lines at the end of the file in windows, then we can able to get one blank line in unix.
It is like
For 2 Blank lines in windows , we get 1 blank line in unix
For 3 Blank lines in windows , we get 2 blank line in unix
For 4 Blank lines in windows , we get 3 blank line in unix........

Last edited by Nandagopal; 05-27-2009 at 07:22 AM..
  #4 (permalink)  
Old 05-27-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,877
Did you transfer the file in ASCII or binary mode? Are you sure the final empty line is missing? You can check this by opening the file in vi and entering
Code:
:set list
in command mode. If there's a single '$' showing in the last line it's empty.
  #5 (permalink)  
Old 05-27-2009
AlbertGM AlbertGM is offline
Registered User
  
 

Join Date: Mar 2009
Location: Barcelona - Catalonia
Posts: 28
Which transfer mode do you use? Try to switch it!!!

Regards,
Albert
  #6 (permalink)  
Old 05-27-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,877
Again, how do you check this? Some UNIX editors (including vi/vim) automatically append a newline to the last line, so this might be the reason why it's not showing. Example:
Code:
$ printf "Test" > test_noeol.txt
$ printf "Test\n" > test_eol.txt
$ printf "Test\n\n" > test_dbleol.txt
$ file test_*.txt
test_noeol.txt:  ASCII text, with no line terminators
test_eol.txt:    ASCII text
test_dbleol.txt: ASCII text
$ cat test_noeol.txt
Test$ cat test_eol.txt
Test
$ cat test_dbleol.txt
Test

$
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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




All times are GMT -4. The time now is 05:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0