-
Changing Unix <CTRL>M to DOS
I have an application that does a "shell" call that opens a cygwin shell and then creates a file from that cygwin shell. As would be expected, the file is created using the Unix <Ctrl>M character as the new line feed. Therefore, when the file is opened (by the same application) later in the application, it sees the contents of the file as a single line.
That said, what I would like to accomplish is to convert the Unix line feeds to the DOS environment. Is there anyway within VB this can be accomplished?
I'd appreciate any suggestions . . .
Thanks,
kgk
-
you can use the Replace method to change all the <Ctrl>M into vbCrLf
if the file is small enough you can read it into a string, if not, you have to read smaller pieces.
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
thanks for the quick reply Marco. My problem is I'm quite the novice with VB and I'm not finding much documentation on how I would set this up. Do you have any example code that would help in this - or maybe point me to a place I might find it?
kgkidd
-
on which part do you need help? Opening the file, read it, using Replace, or display it? Do you have MSDN installed?
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
No, I'm afraid MSDN is not installed and I'm in such a controlled environment that isn't going to happen. Specifically I'm looking for help on using Replace.
Thanks Marco
kgkidd
-
leaving a programmer without MSDN is suicidal...
at least you have internet access, you can get the help online at www.msdn.com (but itis not the same as hitting F1 on the keyboard!)
http://msdn.microsoft.com/library/de...fctreplace.asp
This for example
Replace$("aSssSw","s","Q",,,vbTextCompare)
will return "aQQQQw"
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
Yes, it seems very suicidal here - but that help is exactly what I'm looking for. Thank you very much Marco.
Similar Threads
-
By pwilmarth in forum .NET
Replies: 0
Last Post: 11-22-2002, 12:23 PM
-
By Alice Claussen in forum ASP.NET
Replies: 2
Last Post: 08-08-2002, 01:13 PM
-
By Jeff Jones in forum Open Source
Replies: 6
Last Post: 07-11-2002, 10:37 AM
-
By Glen Kunene in forum Talk to the Editors
Replies: 17
Last Post: 03-23-2002, 12:43 AM
-
By Andrew Sisson in forum Enterprise
Replies: 0
Last Post: 02-02-2001, 11:31 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks