Solved

dos 2 linux

Posted on 2003-11-04
5
813 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
  • 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

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…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now