Solved

dos 2 linux

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RHEL6 + dockers - No route to host 7 104
How to use question mark (?) in filename with html 25 135
Zimbra and Renewing SSL Certficate 9 61
Linux recover lost file deleted by mv 1 31
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

739 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