Replicate Textpad's file format setting

I've written a C# program to process a file.  It only works if I open the file in textpad and go to save as.  There are two options at the bottom of the dialogue.  They are file format and encoding.  I must change the file format from "no change" to "PC".  
What's the difference between the two formats?
How can I achieve this programmatically?
I'm using C# for windows programming with visual studio 2008.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Luis PérezSoftware Architect in .NetCommented:
When your program doesn't work, is it throwing any exception? If so, can you post that?
AlHal2Author Commented:
It's inputting the first line and ignoring subsequent lines.  I opened the input file in hexedit.  It seems like the lines are ending with characters 13,10,13 instead of 13,10.
13=carriage return.  10= line feed.
Luis PérezSoftware Architect in .NetCommented:
Can you attach both files, one of them "as is" and another one saved in TextPad? So I can see the differences between them and see if there's any way in .Net to replicate that...
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

AlHal2Author Commented:
Please take a look.
AlHal2Author Commented:
Please ignore rawfileaftertexpad.txt.
Compare rawfile.txt with rawfileaftertextpad2.txt which I'm just attaching.  Sorry for the confusion.
AlHal2Author Commented:
Please let me know if anything is unclear.
Luis PérezSoftware Architect in .NetCommented:
Ok, after deep looking at both files, I've seen what's the difference. The first one uses the Macintosh style for line breaks, which is the contatenation of Carriage Return + Carriage Return + Line Feed (ascii characters 13+13+10); the second one uses the Dos/Windows style, which is only Carriage Return + Line Feed (ascii 13+10).

You can use this simple function to convert one file from Mac style to Windows style (it uses the System.IO namespace):

private void convertMacToWindows(string fileName)
    string macText = File.ReadAllText(fileName);
    string macNewline = ((char)13).ToString() + ((char)13).ToString() + ((char)10).ToString();
    string pcNewline = ((char)13).ToString() + ((char)10).ToString();
    string pcText = macText.Replace(macNewline, pcNewline);
    File.WriteAllText(fileName, pcText);

Open in new window

Please, try it and tell me if it works now.

Hope that helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlHal2Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

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.