C
cat
In Access2003, I have a db with a table where one of the fields is field type
memo. This field is populated with data that appears to be a string of text.
That text string is actually multiple lines. I need to parse that data
(separated by the next line or end of line indicators which appear as a
square in the string of text) and then put each line into its own record.
When I copy and paste to excel, or export to a text file and import back in,
or even paste in this message, it pastes the way I need it.
For example:
In memo field, appears as:
1.10 Agent <> 2.52 FT: 10 Listings <>7. California - Northern and Hawaii #21
Where <> is actually the next line indicator, which appears as a square.
I want to convert it to this:
1.10 Agent
2.52 FT: 10 Listings
7. California – Northern and Hawaii #21
I was able to write code in VB to do this by manipulating the sytem; I open
a recordset in VB (the table), pull in the field, one line at a time, and for
each line, I export the data to a text file, import back in to a temporary
table, and then append to a separate table with the original client Id. This
works, howevever, when I try to feed several thousand records through, I get
a run time error.
My other thought was I could feed each line through and read each char until
I get to the next line indicator, and slplit that way, but I do not know what
to set the variable equal to to find that char (I.e., how does VB read this
"next line" indicator -the square?)
Is there a better way - there has to be!
Bottom line: How can I take each record and parse and transpose to split
each line into its own field and record?
memo. This field is populated with data that appears to be a string of text.
That text string is actually multiple lines. I need to parse that data
(separated by the next line or end of line indicators which appear as a
square in the string of text) and then put each line into its own record.
When I copy and paste to excel, or export to a text file and import back in,
or even paste in this message, it pastes the way I need it.
For example:
In memo field, appears as:
1.10 Agent <> 2.52 FT: 10 Listings <>7. California - Northern and Hawaii #21
Where <> is actually the next line indicator, which appears as a square.
I want to convert it to this:
1.10 Agent
2.52 FT: 10 Listings
7. California – Northern and Hawaii #21
I was able to write code in VB to do this by manipulating the sytem; I open
a recordset in VB (the table), pull in the field, one line at a time, and for
each line, I export the data to a text file, import back in to a temporary
table, and then append to a separate table with the original client Id. This
works, howevever, when I try to feed several thousand records through, I get
a run time error.
My other thought was I could feed each line through and read each char until
I get to the next line indicator, and slplit that way, but I do not know what
to set the variable equal to to find that char (I.e., how does VB read this
"next line" indicator -the square?)
Is there a better way - there has to be!
Bottom line: How can I take each record and parse and transpose to split
each line into its own field and record?