MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

empty lines

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp
Author Message
csharpula csharp



Joined: 11 Aug 2007
Posts: 14

PostPosted: Wed Feb 27, 2008 1:18 pm    Post subject: empty lines Reply with quote

Hello,

I read a file via Stream Reader which is associated with web response
from linux server and using Stream Writer to write to a text file.
I read a text file and for some reason I read an extra empty line which
is not part of the file.Why can it happen? Maybe it has something to do
with Linux via Windows ?
I did : streamReader.NewLine ="\n" and it didn't help.
Why is that?
Thanks!


*** Sent via Developersdex http://www.developersdex.com ***

Archived from group: microsoft>public>dotnet>languages>csharp
Back to top
View user's profile Send private message
not_a_commie



Joined: 11 Aug 2007
Posts: 1

PostPosted: Wed Feb 27, 2008 2:14 pm    Post subject: Re: empty lines Reply with quote

> I did : streamReader.NewLine ="\n" and it didn't help.

Try "\r\n" or just "\r". Does Stream Reader have a text/binary mode
toggle? If you read the file with File.ReadAllText variants do you see
the same problem?
Back to top
View user's profile Send private message
Rene



Joined: 11 Aug 2007
Posts: 5

PostPosted: Wed Feb 27, 2008 6:18 pm    Post subject: Re: empty lines Reply with quote

Is my understanding that operating systems like Linux will used LF (line
feed) to represent a new line where operating systems such as Microsoft
Windows use CR+LF (Carriage return + Line Feed) to represent a new line.

Could this be the cause of your problems?



"csharpula csharp" wrote in message @TK2MSFTNGP03.phx.gbl...
>
> Hello,
>
> I read a file via Stream Reader which is associated with web response
> from linux server and using Stream Writer to write to a text file.
> I read a text file and for some reason I read an extra empty line which
> is not part of the file.Why can it happen? Maybe it has something to do
> with Linux via Windows ?
> I did : streamReader.NewLine ="\n" and it didn't help.
> Why is that?
> Thanks!
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
Back to top
View user's profile Send private message
Arne_Vajhøj



Joined: 08 Aug 2007
Posts: 39

PostPosted: Wed Feb 27, 2008 11:22 pm    Post subject: Re: empty lines Reply with quote

csharpula csharp wrote:
> I read a file via Stream Reader which is associated with web response
> from linux server and using Stream Writer to write to a text file.
> I read a text file and for some reason I read an extra empty line which
> is not part of the file.Why can it happen? Maybe it has something to do
> with Linux via Windows ?

My guess is that the web server returned:

line 1
line 2
....
line n

which turns out to be:

line 1
line 2
....
line n
(blank line)

And I would not really consider it a problem.

Arne
Back to top
View user's profile Send private message
christery



Joined: 25 Nov 2007
Posts: 1

PostPosted: Wed Feb 27, 2008 11:51 pm    Post subject: Re: empty lines Reply with quote

On 28 Feb, 00:22, Arne Vajhøj wrote:
> csharpula csharp wrote:
> > I read a file via Stream Reader which is associated with web response
> > from linux server and using Stream Writer to write to a text file.
> > I read a text file and for some reason I read an extra empty line which
> > is not part of the file.Why can it happen? Maybe it has something to do
> > with Linux via Windows ?
>
> My guess is that the web server returned:
>
> line 1
> line 2
> ...
> line n
>
> which turns out to be:
>
> line 1
> line 2
> ...
> line n
> (blank line)
>
> And I would not really consider it a problem.
>
> Arne

Or reading between the lines...

line 1
(blank line)
line 2
(blank line)
...
(blank line)
line n
(blank line)

Go for the CR/LF translation problem, got some of the same from VMS,
but lacking breaks, so the text is just one line, but
looooooooooong...
//CY

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
GDI+ Lines disappears I m building a drawing application (VB.NET) and i try to mimic the way lines are used in Visio. I created two controls for each edge, and i draw a line from startEdge to endEdge. All these are done on a panel. Problem is when i add two lines (two sets of

GridView Hide empty row (vb) Hi, I have read several resources on the internet and MSFT newsgroups on how to insert data using the footer in the datagrid control. To solve the empty data set problem, I added a blank row in the datasource select statement, using the union command

Empty datasets in N-Tier App Hi all, FYI: I'm pretty much a novice coming over from AccessXP. After watching the Webcast about buiding N-Tier applications I created an SQL database and built the application as was shown by Paul Sherriff. The only problem I seem to be having at the mo

XPath to node with empty value Hi all, Basically i want to do get the specific node that is empty but when i try the following i get a null node even though I know there is a node whose AN value is null. What am i doing wrong? Than

DataBoundSource has objects but DataBoundItem is empty in Ce I must be missing something I have your basic DataGridView with its set to a collection object that is subclassed from Objects are added to the collection. With the debugger I can see that the
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group