Problems with streamwriter output to.csv..........help needed
-
Hi, I'm trying to write to a file which shud be .csv. I'm using streamwriter for that as StreamWriter sw = new StreamWriter (Server.MapPath"~/ImportData/Files/"+_FileName),true,Encoding.Unicode); Now the problem is, when i try to open the file in excel does not see the commas in the file and puts all data for that row in the first column. I can resolve this issue by replacing Unicode with Default, but this solve the problem only for culture english. I should definatley go with Unicode, as i have to use this for different cultures. Please, let me know if any ideas, as I'm stuck on this. Thanks robust
-
Hi, I'm trying to write to a file which shud be .csv. I'm using streamwriter for that as StreamWriter sw = new StreamWriter (Server.MapPath"~/ImportData/Files/"+_FileName),true,Encoding.Unicode); Now the problem is, when i try to open the file in excel does not see the commas in the file and puts all data for that row in the first column. I can resolve this issue by replacing Unicode with Default, but this solve the problem only for culture english. I should definatley go with Unicode, as i have to use this for different cultures. Please, let me know if any ideas, as I'm stuck on this. Thanks robust
wrote:
let me know if any ideas
Don't cross post. You asked this same thing yesterday in the General Discussion forum.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Hi, I'm trying to write to a file which shud be .csv. I'm using streamwriter for that as StreamWriter sw = new StreamWriter (Server.MapPath"~/ImportData/Files/"+_FileName),true,Encoding.Unicode); Now the problem is, when i try to open the file in excel does not see the commas in the file and puts all data for that row in the first column. I can resolve this issue by replacing Unicode with Default, but this solve the problem only for culture english. I should definatley go with Unicode, as i have to use this for different cultures. Please, let me know if any ideas, as I'm stuck on this. Thanks robust
Have you even looked at the file in notepad to see if the commas are actually there?
Just because we can; does not mean we should.
-
Have you even looked at the file in notepad to see if the commas are actually there?
Just because we can; does not mean we should.
Yeah, i looked in notepad......its perfect over there........As I said, when i give the encoding as default then it wrks perfect in english culture.... but it is mandatory that it shud also wrk in other cultures such as french and german.....it writes perfectly to the notepad....but when i try to open with excel it screws.....