Split a field into multiple fields using space as delim

Split a field into multiple fields using space as delim

am 18.10.2007 13:17:43 von andy.bayley

Hi - and thanks for reading this.
I'm setting up a scheduled routine which links to an existing file.
It's bringing in one field which has at least 2 and maybe 10 'words',
separated by spaces, which I'd like to split into separate fields.
So:
ALTAI RPS 21 CX HPH
would become
ALTAI in a new field, RPS in the next new field etc.
At the moment, I'm wrestling with a query with instr functions all
over the place. If anyone has seen/used a routine to simplify this,
I'd be very grateful!
Cheers.
Andy.

Re: Split a field into multiple fields using space as delim

am 18.10.2007 13:41:08 von Allen Browne

See the ParseWord() function here:
http://allenbrowne.com/func-10.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
news:1192706263.845155.306280@v29g2000prd.googlegroups.com.. .
> Hi - and thanks for reading this.
> I'm setting up a scheduled routine which links to an existing file.
> It's bringing in one field which has at least 2 and maybe 10 'words',
> separated by spaces, which I'd like to split into separate fields.
> So:
> ALTAI RPS 21 CX HPH
> would become
> ALTAI in a new field, RPS in the next new field etc.
> At the moment, I'm wrestling with a query with instr functions all
> over the place. If anyone has seen/used a routine to simplify this,
> I'd be very grateful!
> Cheers.
> Andy.

Re: Split a field into multiple fields using space as delim

am 18.10.2007 14:04:53 von andy.bayley

Fantastic!! Thanks very much. A bit of tweaking and it works
beautifully!

Andy.


On Oct 18, 12:41 pm, "Allen Browne"
wrote:
> See the ParseWord() function here:
> http://allenbrowne.com/func-10.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users -http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> wrote in message
>
> news:1192706263.845155.306280@v29g2000prd.googlegroups.com.. .
>
>
>
> > Hi - and thanks for reading this.
> > I'm setting up a scheduled routine which links to an existing file.
> > It's bringing in one field which has at least 2 and maybe 10 'words',
> > separated by spaces, which I'd like to split into separate fields.
> > So:
> > ALTAI RPS 21 CX HPH
> > would become
> > ALTAI in a new field, RPS in the next new field etc.
> > At the moment, I'm wrestling with a query with instr functions all
> > over the place. If anyone has seen/used a routine to simplify this,
> > I'd be very grateful!
> > Cheers.
> > Andy.- Hide quoted text -
>
> - Show quoted text -