Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

unix2dos with .net

Posted on 2013-01-23
5
Medium Priority
?
366 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
[X]
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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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. …

618 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