Re: Read text file to Temp file and apply formating and color chan
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Tue, 21 Aug 2007 19:17:24 -0700
Brian Cook wrote:
Sure thing Peter, Here is the code. Do you need me to email you a sample file?No. As I said in my post, your sample code should auto-generate some relevant data. That way, no one has to have an exact copy of the sample file you are using.
Sorry, I thought I had answered that. I have not tried to auto-generate some relevant data, as I am unsure how to do that being new to C#.
It should not be much different from how you'd do it in any other language. Your data appears to have a fairly regular format. So it should not be hard. In fact, if anything it's likely easier in C#/.NET because the most complicated thing in your data -- the time stamp -- is easily supported using the DateTime class and associated string formatting options.
As above, no I have not tried doing that as I was not aware of that technique, and do not know how to do it.
Well, I did mention it twice before. :)
I am doing what I can to learn this as I go along, and have made good progress on some of what I consider the harder things. This is still very new.
No doubt the new environment can seem daunting. However, please do keep in mind that we are not here to write your code for you. You will necessarily have to do the bulk of the work, and that does mean taking the time to learn the new concepts that are introduced as they come up in the discussion.
If that takes some time, that's just how it has to be. It may mean that you have to spend a day or two familiarizing yourself with the additional concepts before you reach a point where you can post another question. But that's not wasted time; it will serve you well as you move forward in your use of .NET.
What's _not_ a good idea, IMHO, is to simply ignore the suggestions offered and not bother to respond to them.
Pete I will gladly try your suggestion. I just don't know how to do it.. That is why I posted here so that I can get suggestions (e.g. examples) of how I can do it, or assistance in figuring it out.
My best suggestion is that when a specific property or method in a class is mentioned to you, your first step is to review the MSDN documentation for that property or method. I wrote about the RichTextBox.Rtf property specifically, and the documentation for it can be found here:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.richtextbox.rtf.aspx
On that page, there is this comment: "For the RTF codes, see "rich text format (RTF) Specification, version 1.6" in the MSDN library". Entering the words "rich text format specification" in the MSDN search field and executing the search produces this page as the very first result:
http://msdn2.microsoft.com/en-us/library/aa140277%28office.10%29.aspx
In that document, you should be able to find everything you need to know about inserting the desired formatting codes into a text string to make it suitable for assignment to the RichTextBox.Rtf property.
In addition to all that, there's always good old reverse-engineering and trial and error. You could easily format the text the way you are doing it now, and then get the Rtf property to see what the results look like. Then you just reproduce that going the other way.
We all have to start someplace, and I am at the beginning, without any classes, years of C++ experiance or other practical knowledge.
Understood. And I hope you have not been given the impression that we (and I in particular) expect you to know everything without needing any guidance.
However, as I hope I've reasonably illustrated above, it would not have been all that hard for you to go from reading my suggestion that you use the RichTextBox.Rtf property, to finding detailed documentation explaining everything you should need to know about using it, or otherwise educating yourself on its use. I could write a post spelling it all out for you, but IMHO given that MSDN has already put it all together for you already, there should be no need for me to duplicate that effort.
If after reviewing the documentation, you _still_ have questions, that's an entirely different matter. The documentation is not always perfectly clear, and in some cases it may make more sense to someone with at least a little experience with writing Windows software. It's absolutely reasonable to post a question asking (among other things) for an explanation of something in the documentation. It's just that it's important that you do that initial leg-work yourself.
Now, all that said...it's possible that simply reviewing the code you posted, something useful will jump out. With three and a half minutes to process just 7MB of data, it seems likely to me that there's at least one obvious algorithmic error, and maybe more than one. :)
So lacking the inclusion of some code to auto-generate some test data, it's possible I or someone else might be able to provide some good feedback regarding the algorithm you're using. I'll get a chance to look at the code soon, and if I notice anything I'll post another reply to the post with the code.
Pete
.
- Follow-Ups:
- Re: Read text file to Temp file and apply formating and color chan
- From: Brian Cook
- Re: Read text file to Temp file and apply formating and color chan
- References:
- Re: Read text file to Temp file and apply formating and color changes
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Read text file to Temp file and apply formating and color chan
- From: Peter Duniho
- Re: Read text file to Temp file and apply formating and color chan
- From: Brian Cook
- Re: Read text file to Temp file and apply formating and color chan
- From: Peter Duniho
- Re: Read text file to Temp file and apply formating and color chan
- From: Peter Duniho
- Re: Read text file to Temp file and apply formating and color chan
- From: Brian Cook
- Re: Read text file to Temp file and apply formating and color chan
- From: Peter Duniho
- Re: Read text file to Temp file and apply formating and color changes
- Prev by Date: Re: File reading problem from DVD writer
- Next by Date: Re: Read text file to Temp file and apply formating and color chan
- Previous by thread: Re: Read text file to Temp file and apply formating and color chan
- Next by thread: Re: Read text file to Temp file and apply formating and color chan
- Index(es):
Relevant Pages
|
|