Writing the content of a text file
-
hi all, i want to write the content of a text file to another txt file exactly like what i have in original file. i used write,writeline and put functions. but to my surprise, i found the text file is benig written without the new line character. for example: original file content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoijf faioj Para 2: fafaopfopfkaokfopfaopkfopkopafopkfpoaf. fijaoijij fafijoifjfiajparwto MY COPIED FILE content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoij ffaioj Para 2: afaopfopfkaokfopfaopkfopkopafopkfpoaf. ijaoijij fafijoifjfiajparwto Can anyone help me on how to write the content of the file exactly as what i have in original? Thanks, mahi.
-
hi all, i want to write the content of a text file to another txt file exactly like what i have in original file. i used write,writeline and put functions. but to my surprise, i found the text file is benig written without the new line character. for example: original file content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoijf faioj Para 2: fafaopfopfkaokfopfaopkfopkopafopkfpoaf. fijaoijij fafijoifjfiajparwto MY COPIED FILE content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoij ffaioj Para 2: afaopfopfkaokfopfaopkfopkopafopkfpoaf. ijaoijij fafijoifjfiajparwto Can anyone help me on how to write the content of the file exactly as what i have in original? Thanks, mahi.
-
hi all, i want to write the content of a text file to another txt file exactly like what i have in original file. i used write,writeline and put functions. but to my surprise, i found the text file is benig written without the new line character. for example: original file content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoijf faioj Para 2: fafaopfopfkaokfopfaopkfopkopafopkfpoaf. fijaoijij fafijoifjfiajparwto MY COPIED FILE content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoij ffaioj Para 2: afaopfopfkaokfopfaopkfopkopafopkfpoaf. ijaoijij fafijoifjfiajparwto Can anyone help me on how to write the content of the file exactly as what i have in original? Thanks, mahi.
File.Copy
is the simple way. Copying bytes, not characters (hence using a byte array), is the alternative. :)Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
hi all, i want to write the content of a text file to another txt file exactly like what i have in original file. i used write,writeline and put functions. but to my surprise, i found the text file is benig written without the new line character. for example: original file content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoijf faioj Para 2: fafaopfopfkaokfopfaopkfopkopafopkfpoaf. fijaoijij fafijoifjfiajparwto MY COPIED FILE content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoij ffaioj Para 2: afaopfopfkaokfopfaopkfopkopafopkfpoaf. ijaoijij fafijoifjfiajparwto Can anyone help me on how to write the content of the file exactly as what i have in original? Thanks, mahi.
Is the text in memory, or is it still in the original file?
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Is the text in memory, or is it still in the original file?
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001text is not in memory ..its in original text file only.
-
text is not in memory ..its in original text file only.
Then do what everyone else said, and just use
File.Copy
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
hi all, i want to write the content of a text file to another txt file exactly like what i have in original file. i used write,writeline and put functions. but to my surprise, i found the text file is benig written without the new line character. for example: original file content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoijf faioj Para 2: fafaopfopfkaokfopfaopkfopkopafopkfpoaf. fijaoijij fafijoifjfiajparwto MY COPIED FILE content: aefaiojefioae fafajfpfjafaffjaeiofjafjfjfi faijfoij ffaioj Para 2: afaopfopfkaokfopfaopkfopkopafopkfpoaf. ijaoijij fafijoifjfiajparwto Can anyone help me on how to write the content of the file exactly as what i have in original? Thanks, mahi.
I agree. I think File.Copy would be your best solutions if you want your text file to be exactly the same as the original.
Plecco Technologies, Inc. Web Design | Software Development | Internet Marketing
modified on Wednesday, January 27, 2010 10:02 AM