Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writting a text file to unix 1

Status
Not open for further replies.

dadamec

Technical User
Apr 9, 2001
2
US
I am a newbie to vb and have created a programme to create a text file from either operator input or extracting information from a parasolid drawing file. the text file is used in an oracle optegra database to assign attribute information to allow for part information search.. The programme itself works fine and a text file is created but with a catch.. The text file is used in a unix environment and when the file is created it is in dos format with ^M at the end of each line, I gather this is a line feed or carriage return. Unfortunatly ^M are not recognised in unix and the text file is rejected as having unrecognised characters.. How do I create the text file without these ^M's. I use the print command to create the text file to an open file..
any help would be appreciated.
Cheers Dave
 
The line separator in UNIX is Linefeed (LF), in DOS it is linefeed and carriage return (LF and CR).
Then you use the print command it will put in a LFCR in the end of each line.
You can avoid this by opening the file for binary and use the PUT statement to print your text to the file. PUT does not print any line separators to the file, so remember to put a LF (ascii character 10 I think) in to separate the lines.
An other possiblity is that you run one of the many small DOS2UNIX conversions programs after you created the file (you could do this using the shell command).

:)Good luck,
Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top