New topic: 

TextOutputStream End of Line Issue = Need Help (:

<http://forums.realsoftware.com/viewtopic.php?t=46867>

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        otosnede          Post subject: TextOutputStream End of Line 
Issue = Need Help (:Posted: Thu Feb 07, 2013 5:39 pm                         
Joined: Thu Feb 07, 2013 12:45 pm
Posts: 3                I have a TextArea in my project and I'm pulling in text 
from a Shell.ReadAll method and putting it into the TextArea. When the text is 
viewed in the app, it looks perfect... all line endings are correct. Now when I 
save the TextArea output to a file, I'm getting these results:

* Notepad in Windows reads it all as one line* WordPad in Windows shows it 
correctly with all the line endings in place so it's readable
I'm assuming this is some sort of line ending setting somewhere, but not sure 
how to solve it as I've already tried numerous things.

Anyone got any suggestions on how to make it so Notepad will interpret the line 
endings correctly?

TIA   
                             Top                charonn0          Post subject: 
Re: TextOutputStream End of Line Issue = Need Help (:Posted: Thu Feb 07, 2013 
6:09 pm                                 
Joined: Mon Apr 02, 2007 2:08 am
Posts: 1111
Location: San Francisco, CA, USA                Try using the 
ReplaceLineEndings method on the shell output to standardize the EndOfLine 
marker. Notepad expects line endings to be Win32-syle EoL markers, so something 
like this should work:

Dim sh As New Shell
sh.Execute("somecommand.exe")
Dim data As String = sh.ReadAll
data = ReplaceLineEndings(data, EndOfLine.Windows)
'etc.
      
_________________
Boredom Software  
                             Top                timhare          Post subject: 
Re: TextOutputStream End of Line Issue = Need Help (:Posted: Thu Feb 07, 2013 
8:17 pm                         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12055
Location: Portland, OR  USA                TextArea changes the line endings.  
You have to change them back when you pull the text out again.  See 
ReplaceLineEndings, above.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to