Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default Converting text for csv

Where can I find information on how to correctly export a file to csv,
so I can import it in MySQL correctly?

I start with something like "Chaussée". When I export this to csv, I get
"Chauss,e". What I would need is something like "Chaussée", because
when I import that, I do get "Chaussée" back on my site.

I could replace each "é" with "é", but that letter is not the only one
and there might be letters added later that are not there now.

Is there information on what to do exacly, or a script I could download
that does this for me?

--
houghi http://www.houghi.org
My experience with SuSE Linux 9.1

The businessworld is like prison and M$ made everybody their bitch.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Converting text for csv

I get this with the code below : Chaussée
This is the custom code I give everybody who has problems with the Excel CSV
save function. there are lots of problems with the way excel saves CSV
files. This solution always seems to work.

Sub WriteCSV()
Const MyPath = "C:\temp\"
Const WriteFileName = "text.csv"

Const Delimiter = ","
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

Set fswrite = CreateObject("Scripting.FileSystemObject")
'open files
WritePathName = MyPath + WriteFileName
fswrite.CreateTextFile WritePathName
Set fwrite = fswrite.GetFile(WritePathName)
Set tswrite = fwrite.OpenAsTextStream(ForWriting, TristateUseDefault)

LastRow = Cells(Rows.Count, "A").End(xlUp).Row

For RowCount = 1 To LastRow
LastCol = Cells(RowCount, Columns.Count).End(xlToLeft).Column
For ColCount = 1 To LastCol
If ColCount = 1 Then
OutputLine = "," & Cells(RowCount, ColCount)
Else
OutputLine = OutputLine & Delimiter & Cells(RowCount, ColCount)
End If
Next ColCount
OutputLine = OutputLine & ","
tswrite.writeline OutputLine
Next RowCount

tswrite.Close

End Sub
"houghi" wrote:

Where can I find information on how to correctly export a file to csv,
so I can import it in MySQL correctly?

I start with something like "Chaussée". When I export this to csv, I get
"Chauss,e". What I would need is something like "Chaussée", because
when I import that, I do get "Chaussée" back on my site.

I could replace each "é" with "é", but that letter is not the only one
and there might be letters added later that are not there now.

Is there information on what to do exacly, or a script I could download
that does this for me?

--
houghi http://www.houghi.org
My experience with SuSE Linux 9.1

The businessworld is like prison and M$ made everybody their bitch.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default Converting text for csv

Joel wrote:
I get this with the code below : Chaussée
This is the custom code I give everybody who has problems with the Excel CSV
save function. there are lots of problems with the way excel saves CSV
files. This solution always seems to work.


Thanks. I will try it on Monday when I am back at the office and have
Excel available.

houghi
--



This space left blank intentionaly
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a date to a text field w/o converting it to a julian da LynnMinn Excel Worksheet Functions 2 March 6th 08 03:43 PM
Converting Text scats Excel Worksheet Functions 1 November 7th 06 09:14 PM
Converting text??? T Miller Excel Discussion (Misc queries) 5 October 20th 06 06:18 PM
Converting Text to Number Andrew Bartholomew Excel Discussion (Misc queries) 1 March 25th 05 02:50 AM
converting numbers to text and prefill text field with 0's Jan Buckley Excel Discussion (Misc queries) 2 January 20th 05 09:03 PM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"