Sponsored Content
Special Forums Windows & DOS: Issues & Discussions DOS/Windows CR to a UNIX LF 17 MB text file Post 302193117 by tex on Thursday 8th of May 2008 02:30:12 PM
Old 05-08-2008
DOS/Windows CR to a UNIX LF 17 MB text file

Hello,

I am on a WinXP home machine with a 17 MB text file and I need to change the DOS/Windows CR to a UNIX LF.

Does anyone know how I can do this or even better a WinXP program that can do this for me ?

My hobby is my Family History. I know very little about all this type stuff and I need an expert to offer me some help.

I wish to use this windows / DOS program called IGM see here Doug & Anthea Macdonald Homepage to create my web pages on the fly from a GEDCOM file. This GEDCOM is nothing but a .txt file in a special format to meet the GEDCOM standard.

I need to find all Windows Carriage-Return (CR = ASCII 13) and replace them with the UNIX (LF = ASCII 10) at the end of each line in the place of the Windows CR.

I need to do this because this file will reside on a Apache server using UNIX and .CIG script will be ran on this file.

The complier of this program says I will need to change the CR to LF but the program he has provided will not work or at least I can't get it to do anything for me.

The program seems to pre-date XP and I can't get in touch with anyone that complied this program. here is a link to the freeware program IGM Download Information

This is what it said in the how to file included with the IGM program.

"Finally, another difference between DOS/Windows and UNIX is that they denote the end of a line of text within a file in different ways. UNIX puts a Line-Feed character (LF = ASCII 10) at the end of each line, whereas DOS/Windows ends each line with the two-character combination Carriage-Return (CR = ASCII 13) and Line-Feed. Files and scripts with the DOS convention will be uninterpretable when they are uploaded to the UNIX server. Therefore, a small program called d2u.exe is included with the IGM programs. This file, which runs on a PC, removes the CR characters from the end of each line. You should run this program on any file you are going to upload just before uploading it. To run it, just type e.g.

d2u igmget.cgi

at the DOS prompt. Run this file on all of the CGI scripts, plus the GEDCOM file, and any other files you upload. Since this process makes permanent changes to the files which may make them uneditable on your home computer, it is strongly suggested that you make copies of all the files in your special pre-upload directory before performing this step, and make the changes on these copies. Note that whenever you upload a new GEDCOM file, you will have to run d2u.exe on it first. "

I have ran that every way I can think of from the Run command in XP and have even rebooted into safe mode with a command line prompt and nothing.

I can't even tell what the end of line is in this file so how will I know if I get it changed ?

Thanks !

Tex & Linda Dix - Dick
305 Avalee Dr.
Brooks, GA 30205
tex@dixhistory.com
Tex and Linda Dix or Dick Family History
======================
 

9 More Discussions You Might Find Interesting

1. SCO

how can I create a dos file in sco unix?

I want to output something to file1. And I want to see it in windows xp would you tell me how? (2 Replies)
Discussion started by: fresh
2 Replies

2. Shell Programming and Scripting

windows to unix text in subdirectories

Hey, I'm trying to install a java web archive on unix but all the jsp's are in windows text format. I need to convert them all to unix text at once but I really don't want to do that on a file per file basis so I need to loop over all text files in all subdirectories and change the ^M. Does... (4 Replies)
Discussion started by: rein
4 Replies

3. UNIX for Dummies Questions & Answers

Converting Unix text to windows

I am trying to FTP a text file from a machine running LynxOS and I am having problems with the way windows "sees" the characters. For example this is how windows presents the text:     DevProcRcpClass The boxes are what I am having problems with. When viewing the same file on a... (3 Replies)
Discussion started by: mchristisen
3 Replies

4. UNIX for Dummies Questions & Answers

?Using Unix commands in Microsoft (Windows') DOS Prompt?

I ran a search for "Unix Dos" in the search field box and checked a few pages' results but did not find what I was looking for. I am trying to find out if there are choices of applications that would enable using Unix commands inside a Windows environment, particularly the DOS Prompt. The only... (2 Replies)
Discussion started by: HLee1981
2 Replies

5. Shell Programming and Scripting

how to remove ^M from windows text file in unix

Hi, Need help on windows text file that i get in unix server and need to change and resend for process. Now there is a ^M will be placed for each line of that file i need that to be removed . Someone please help me. Thanks in advance for all help. (1 Reply)
Discussion started by: pragy1999
1 Replies

6. Programming

windows to dos file name conversion x'ad'

We are running a java client server application on Solaris 10. External Users from around the country attach windows files through a client and these files are stored on a unix server. Recently I've started getting files that have a hex value of ad in their names. This causes a tar command to... (5 Replies)
Discussion started by: gillbates
5 Replies

7. Shell Programming and Scripting

UNIX command to count blank lines in a file in DOS format

Hi Team, The content of the file is as follows. asdf 234 asdf asdf dsfg gh 67 78 The file is in DOS format (not in Unix Format). The file is transferred to Unix. I need a unix command to check the number of blank lines in a input (comming from Windows). If it is greater than... (4 Replies)
Discussion started by: kmanivan82
4 Replies

8. Windows & DOS: Issues & Discussions

Convert UNIX text file in Windows to recognize line breaks

Hmmm I think I found the correct subforum to ask my question... I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this?... (1 Reply)
Discussion started by: frys_hp
1 Replies

9. UNIX for Dummies Questions & Answers

Convert UNIX text file in Windows to recognize line breaks

Hi all, I have some text files that I prepared in vi some time ago, and now I want to open and edit them with Windows Notepad. I don't have a Unix terminal at the moment so I need to do the conversion in Windows. Is there a way to do this? Or just reinsert thousands of line breaks again :eek: ? (2 Replies)
Discussion started by: frys_hp
2 Replies
mwrite(1)						      General Commands Manual							 mwrite(1)

NAME
mwrite - mtools utility to perform a low level write (copy) of a UNIX file to DOS SYNOPSIS
mwrite [-mntv] unixfile msdosfile mwrite [-mntv] unixfile [unixfiles...] [msdosdirectory] OPTIONS
Preserves the file modification time. Specifies that a warning is not issued when an existing file is specified as the target file. If this option is not specified, the mwrite command verifies whether or not to overwrite an existing file. Specifies a text file transfer. Line terminators are converted to the appropriate format. Specifies verbose mode. Displays the new file name if the UNIX file name requires conversion. DESCRIPTION
The mwrite command copies the specified UNIX file to the named DOS file, or copies multiple UNIX files to the named DOS directory. The destination directory cannot be omitted. Reasonable care is taken to create a valid DOS file name. If an invalid name is specified, the mwrite command changes the name, then displays the new name if the -v option is specified. DOS subdirectory names that contain the '/' or '' separator are supported. If you use the '' separator or wildcards, you must enclose file names in quotes to protect them from the shell. The mcd command can be used to establish the device and the current working directory (relative to DOS), otherwise the default is A:. Not all UNIX file names are supported in the DOS world. The mwrite command may have to change UNIX names to fit the DOS file name conven- tions. The following table shows some examples of file name conversions: ----------------------------------------------- UNIX name DOS name Reason for the change ----------------------------------------------- thisisatest THISISAT file name too long file.stuff FILE.STU extension too long prn.txt XRN.TXT PRN is a device name .abc X.ABC null file name hot+cold HOTXCOLD illegal character ----------------------------------------------- EXIT STATUS
The following exit values are returned: Success. Failure. ENVIRONMENT VARIABLES
The following environment variables affect the execution of mwrite: If set, this variable names the file that contains the name of the cur- rent mtools working directory as established by the mcd command. If this variable is not set, the file $HOME/.mcwd is used. FILES
Contains the name of the current mtools working directory as established by the mcd command. If this file does not exist, the default mtools working directory is A:. Executable file SEE ALSO
Commands: dos2unix(1) mcd(1), mcopy(1), mdiskcopy(1), mkmanifest(1), mread(1), mtools(1), unix2dos(1) mwrite(1)
All times are GMT -4. The time now is 04:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy