Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

dos 2 linux

Posted on 2003-11-04
5
Medium Priority
?
854 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

670 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