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
Solved

dos 2 linux

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to install Ubuntu 16 in DELL venue 8 pro 20 279
installing docker on ubuntu 6 36
Remote desktop Ubuntu from Windows 10 5 90
linux 13 75
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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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 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…

808 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