View Single Post
 
Old 02-09-2012, 09:12 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi JGT,

I'd be inclined to do this in Word, using a Find/Replace macro like:
Code:
Sub ParseMeals()
Application.ScreenUpdating = False
With ActiveDocument
  .Range.InsertBefore vbCr
  With .Content.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Text = "^t"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
    .Text = "^13{1,}"
    .Replacement.Text = ", ^p"
    .Execute Replace:=wdReplaceAll
    .Text = "([!^13)]{1,}\))*\[([0-9]{1,})*\(([0-9]{1,})(*\), )"
    .Replacement.Text = "^^\2|\3|\1"
    .Execute Replace:=wdReplaceAll
    .Text = "^13^94"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
  End With
  .Paragraphs.First.Range.Delete
  .Characters.Last.Delete
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote