Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

unix2dos with .net

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
chadmanvb
Asked:
chadmanvb
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
can u post an example?
0
 
chadmanvbAuthor Commented:
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
 
Robert SchuttSoftware EngineerCommented:
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
 
CodeCruiserCommented:
Also, set the Multiline property of textbox to true and increase its height.
0
 
chadmanvbAuthor Commented:
That did it!  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now