Solved

dos 2 linux

Posted on 2003-11-04
5
837 Views
Last Modified: 2008-03-10
I have some vba code that generates text files for upload on our linux based system.  These files will not load unless they are converted to unix format.  I have used  'set ff=unix' in vi and then the files are fine.  (thanks question Q_20787617)
Problem is I don't want to have to do this for all files.  Is there any way of generating the files in the right format from the off.  I'm using access VBA with the command
Print #1, "0" & "," & f1 & c & f2 & "," & f3 & "," & f4 & "," & f5 & "," & ","
Wrong area I know but this seems to be a common problem.

Failing that what about a way of converting all the files in a directory.

PS I'm new to linux and pretty thick

Ta
0
Comment
Question by:danwood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:majorwoo
ID: 9681365
i usually avoid the issue and edit with wordpad from windows, it can handle it correctly.

dos2unix and unix2dos take wildcards though if you want to do the directory at once...
[josh@woo ~]$ dos2unix blah*
dos2unix: converting file blah to UNIX format ...
dos2unix: converting file blah2 to UNIX format ...
dos2unix: converting file blah3 to UNIX format ...


0
 
LVL 5

Accepted Solution

by:
arjanh earned 250 total points
ID: 9681403
This is tool to convert between DOS and linux. It is available both for Windows and for linux
http://www.thefreecountry.com/tofrodos/index.shtml
0
 

Author Comment

by:danwood
ID: 9681469
Excellent.  could not find dos2unix earlier.  must be something to do with the environment on my profile.   works on the consol



0
 
LVL 5

Expert Comment

by:arjanh
ID: 9681476
what happens if you add '& vbCr' (the linux newline character) at the end the print command?
0
 

Author Comment

by:danwood
ID: 9685651
Superb.  Everything I need.  Finaly used tofrodos to create a batch file that converts the files then ftps them to the server.
Works prerfectly.  
arjanh,  didnt try vbCR but was using vbCrLf   which was probably the problem.  Never mind. done now

Thanks a lot

d
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question