473,378 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

NewLine characters lost when archiving the files

Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance
Nov 17 '05 #1
5 3394
try

Environment.NewLine

byez

--
imperugo (exCartman)
myblog : http://imperugo.blogspot.com
"SunSmile" <Su******@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying
a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance

Nov 17 '05 #2
Hi imperugo,
Thank's for your reply.
I have tried Environment.NewLine but still the new line character is lost.
I have even tried a HTML break(using C# in ASP.net) still the new line
character is lost.

Does the newline character work only in word documents?.

Thanks

Nov 17 '05 #3
how are you archiving the doc to doc.1?

1- is it only name change or
2- you are reading the file and then saving as doc.1?

can you post some code also.

Thanks.

"SunSmile" <Su******@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying
a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance

Nov 17 '05 #4
Hi Pohihihi ,
Thanks for your reply. The archiving of the files is done through
Log4Net Config file.
Below is the skelton of Log4Net Config file.
<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\Logs\logmasters.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />

<maxSizeRollBackups value="10" />
<maximumFileSize value="1KB" />
<staticLogFileName value="true" />
<header type="log4net.Util.PatternString" value="START
pid=%processid date=%date %newline" />

<layout type="log4net.Layout.PatternLayout">
<ContentType type="log4net.Util.PatternString" value="%newline"
/>
<conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
</layout>

I am i missing something?.
Thank you.

Pohihihi wrote:
how are you archiving the doc to doc.1?

1- is it only name change or
2- you are reading the file and then saving as doc.1?

can you post some code also.

Thanks.

"SunSmile" <Su******@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying
a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance


Nov 17 '05 #5
Hi Pohihihi ,
Thanks for your reply. The archiving of the files is done through
Log4Net Configuration file. Following is the skelton of my Log4Net Config
file.

<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\Logs\logmasters.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />

<maxSizeRollBackups value="10" />
<maximumFileSize value="1KB" />
<staticLogFileName value="true" />
<header type="log4net.Util.PatternString" value="START
pid=%processid date=%date %newline" />

<layout type="log4net.Layout.PatternLayout">
<ContentType type="log4net.Util.PatternString" value="%newline"
/>
<conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
</layout>

I am i missing something here?.
Any suggestions are furthur welcome.

Thank You.
"Pohihihi" wrote:
how are you archiving the doc to doc.1?

1- is it only name change or
2- you are reading the file and then saving as doc.1?

can you post some code also.

Thanks.

"SunSmile" <Su******@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
Hi,
I am logging my exceptions to a word document(*.doc). After the size of
word document is 5KB. I am archiving the word document to *.doc.1

Here when I am archiving the word document to *.doc.1, the new line
characters("\r\n") are lost and the *.doc.1 document is instead displaying
a
null square space.

I am using Log4Net to log the exceptions.

Can anyone suggest a way around to preserve the New Line Character?.

Any furthur comments and suggestions are welcome.

Thanks in advance


Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Howard Kaikow | last post by:
I have never seen WriteLine fail to produce a NewLine, at least, not until now: I was playing with an example given on pages 51-52 of the book "A Visual Basic 6 Programmer's Toolkit". The book...
0
by: Howard Kaikow | last post by:
I have never seen WriteLine fail to produce a NewLine, at least, not until now: I was playing with an example given on pages 51-52 of the book "A Visual Basic 6 Programmer's Toolkit". The book...
29
by: runningdog | last post by:
Hi, I would like to be able to embed a newline in a text string. Is there any convienent notation to do this TIA Steve
1
by: utab | last post by:
Hi there I am trying to read from a file, I am trying to read certain fields,there are 6 fields in this file like --------/--------/--------/--------/--------/--------/ All fields are 8...
5
by: Adam Right | last post by:
Hi, Is there a way to construct the mail body including newline characters by using .net framework mailing functions when sending an email? I cannot insert newline character into the body of the...
3
by: Thomas | last post by:
Hi All, i am getting this error once i submit my page to a payment gateway and when it returns the reponse back. Redirect URI cannot contain newline characters. Description: An unhandled...
3
bvdet
by: bvdet | last post by:
Following is an example that may provide a solution to you: """ Function makeArchive is a wrapper for the Python class zipfile.ZipFile 'fileList' is a list of file names - full path each name...
1
by: linq936 | last post by:
Hi, I read in many places that the string to be outputted by printf() must be ending with newline, for example, it should be printf("Hello World.\n"); instead of printf("Hello World.");
3
by: ofilha | last post by:
I am trying to export the resultset of a query to a character delimited file. I am using the wizard for this. However, one of the fields is 512 characters long and it accepts from form address. It...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.