excel - Adding newline based on 'find character' and go back to first space -


i'm working on cleaning ton of data has common pattern this:

reg#: 15082608 date:15-jun-15 backtrack cleared: date:31-aug-15 recvd:13-may-15 agency:oakland (and 25 other data points each record but, following pattern). raw pdf file bunch of records here: http://abc.ca.gov/reports/actions2015/actionsfinal_09-23-15.pdf

i'm not programmer but, have tried refine , bunch of excel tests but, haven't found way can large number of records (thousands but, start dozens :). so, question is:

could script identify colon ':' , go backwards first space before colon eg 'date:15-jun-15 backtrack cleared: date:31-aug-15' , enter new line each instance? resulting output be:

date:15-jun-15 backtrack  cleared:  date:31-aug-15 

the other question can manually copy , paste each record (of 25+ data points) unique cell but, ideal save pdf spreadsheet , builds row every row finds - meaning in cells there multiple colons , need script bump down other rows accordingly.

once place can text-to-column , build database there.

select cells containing data , run short macro:

sub fixdata()    dim r range, v string, vout string    each r in selection       v = r.text       vout = ""       if v <> ""          ary = split(v, " ")          = lbound(ary) ubound(ary)             if instr(1, ary(i), ":") > 0                vout = vout & vbcrlf & ary(i)             else                vout = vout & " " & ary(i)             end if          next          r.value = vout       end if    next r end sub 

before:

enter image description here

and after:

enter image description here


Comments