[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

unix2dos with .net

Posted on 2013-01-23
5
Medium Priority
?
374 Views
Last Modified: 2013-01-23
I have some code that is getting output from a Linux script and I display it in a textbox.  How can I convert this to display correctly on my screen?  I would like to do this without having to write the file out.  Can I do a unix2dos conversion in .net?
0
Comment
Question by:chadmanvb
5 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 38809751
can u post an example?
0
 

Author Comment

by:chadmanvb
ID: 38809911
When I display the output into a text box it does not see the correct line breaks.  It looks and shows up as one long line. It should only show 2 lines and line up the columns.
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 38809922
The problem with this usually is in the different line endings. To convert the unix 'linefeed-only' to the dos/windows 'cr/lf' you can use:
TextBox1.Text = strUnixText.Replace(vbLf, vbCrLf)

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38809973
Also, set the Multiline property of textbox to true and increase its height.
0
 

Author Closing Comment

by:chadmanvb
ID: 38810234
That did it!  Thanks.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 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