convert .doc to .csv

  cspgsl 15:33 26 Jan 2006

I'm new at this so bear with me please.
I am trying to convert a table in a Word .doc into a .csv to import into mysql.
When I copy the contents of a table cell where there are multiple paragraphs within the cell the result in Excel is multiple rows, one for each paragraph.
Can someone give me a hint on what I should be doing so that each cell is contained within o single row?
I tried Shift | Enter in Word to separate the paragraphs but that didnt work. I want to maintain the paragraph structure in the database.

  Forum Editor 17:32 26 Jan 2006

to the helproom, where our Excel experts await.

  VoG II 22:57 26 Jan 2006

You have woken me up now because I cannot understand why you need you go via Excel t
o do this.

In Word you possibly need to use a Shift + Enter to produce a carriage return that Excel will recognise?

A bit more info would help.

  silverous 23:13 26 Jan 2006

One way around it is to convert those paragraph marks & linebreaks to unique
characters, then copy|paste and then convert them back to linefeeds.

I like this technique (inside a copy of the word file):
Select your table.
Edit|replace|Special (show More if required)
Find what: (paragraph mark under Special button)
replace with: $$$$$ (if $$$$$ doesn't appear in the table)
replace all

Same thing with Manual Line break (from under Special).

Now copy the table into Excel.

Replace what: $$$$$
Replace with: hit and hold the alt and type 0010 from the number pad--not above

It may look like you haven't done anything, but if you did it right, you
replaced $$$$$ with alt-enter.
Replace all.

(this is copied from):
click here

  VoG II 09:11 27 Jan 2006

Sub ImportWordTable()
Dim wdDoc As Object
Dim wdFileName As Variant
Dim TableNo As Integer 'table number in Word
Dim iRow As Long 'row index in Excel
Dim iCol As Integer 'column index in Excel
wdFileName = Application.GetOpenFilename("Word files (*.doc),*.doc", , _
"Browse for file containing table to be imported")
If wdFileName = False Then Exit Sub '(user cancelled import file browser)
Set wdDoc = GetObject(wdFileName) 'open Word file
With wdDoc
TableNo = wdDoc.tables.Count
If TableNo = 0 Then
MsgBox "This document contains no tables", _
vbExclamation, "Import Word Table"
ElseIf TableNo > 1 Then
TableNo = InputBox("This Word document contains " & TableNo & " tables." & vbCrLf & _
"Enter table number of table to import", "Import Word Table", "1")
End If
With .tables(TableNo)
'copy cell contents from Word table cells to Excel cells
For iRow = 1 To .Rows.Count
For iCol = 1 To .Columns.Count
Cells(iRow, iCol) = WorksheetFunction.Clean(.cell(iRow, iCol).Range.Text)
Next iCol
Next iRow
End With
End With
Set wdDoc = Nothing
End Sub

To use this, open a blank Excel workbook. ALT + F11 to open the Visual Basic Editor. Insert|Module and paste in the code above. Close the VBE. Go to a blank worksheet, Tools|Macros|Macro, click ImportWordTable and click the Run button.

  cspgsl 09:15 27 Jan 2006

VoG - I attempted to make the transition in Word and found the same problem when converting table to text. Tried Shift + Enter and it didnt resolve. Thought I would try Copy + Paste into Excel to see if it made a difference. Result = no differnece.

Silverous - I'll give the suggestions a try and get back to you.

Thanks for the replies.

  cspgsl 09:16 27 Jan 2006

VoG - I'll give this one a go as well.

  cspgsl 10:02 27 Jan 2006

VoG --
Bingo, that was simple. Wish I had asked the question on Wednesday
Thanks !!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Best phone camera 2017

Stunning new film posters by Hattie Stewart, Joe Cruz & more

iPad Pro 10.5in (2017) review

28 astuces pour profiter au mieux de votre iPhone