Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default extract elements of strings

Morning all.
While I've asked on this general topic before and obtained the solution I
sought, this is different in that I've now used AutoCAD 2009's dataextraction
tool and the text I chose within AutoCAD was a "multi-text."

In doing so I've found that the output into excel resembles the following.

'xxx/Pxxxx/Pxxxx/Pxxxx/P............./Pxxxx
where the x's are a series of numeric values I need to pull and use for my
spreadsheet.

here's an actual sample.

'4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1 .00\P2.96\P1.00\P1.00\P0.96\P0.95\P1.99\P1.00\P1.2 1\P1.00\P1.00\P1.00\P2.10\P2.85\P2.10\P4.92\P6.50\ P2.33\P2.61\P1.00\P1.00\P1.00\P0.99\P1.00\P2.07\P3 .13\P1.00\P1.00\P1.00\P1.00\P1.00\P0.89\P2.55\P\P7 6.60\P

and the other portion of the sample is-- in its own column:

'09-120-01\P09-120-05\P09-120-15\P09-120-22\P09-120-26\P09-120-27\P09-120-28\P09-120-29\P09-120-44\P09-120-45\P09-120-46\P09-120-52\P09-120-53\P09-120-54\P09-120-56\P09-120-57\P09-131-40\P09-131-41\P09-131-42\P09-131-43\P09-131-47\P09-131-49\P09-131-50\P09-132-08\P09-132-13\P09-132-18\P09-132-19\P09-132-29\P09-132-30\P09-132-31\P09-132-34\P09-132-35\P09-132-36\P09-132-37\P09-132-38\P09-132-39\P09-132-40\P09-132-42\P09-132-43\PBasque
Ln.\PJuniper Hill Rd.\P\PTotal\P

I'm looking to extract the numbers/text and place each grouping separated by
the /P's in its own cell, in a single column. In the case of the samples
above, that'd be two columns of data.

How would I accomplish this?
Thank you.
Best.
SteveB.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default extract elements of strings

If A1 contains:

4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1. 00\P2.96\P1.00\P1.00

Select A1 and run this macro:

Sub steve()
v = ActiveCell.Value
s = Split(v, "\P")
For i = LBound(s) To UBound(s)
ActiveCell.Offset(i + 1, 0).Value = s(i)
Next
End Sub

Cells A2 thru A13 will contain:

4.75
5.05
0.16
5.3
1.19
1.01
1.01
1.01
1
2.96
1
1

--
Gary''s Student - gsnu200806


"SteveDB1" wrote:

Morning all.
While I've asked on this general topic before and obtained the solution I
sought, this is different in that I've now used AutoCAD 2009's dataextraction
tool and the text I chose within AutoCAD was a "multi-text."

In doing so I've found that the output into excel resembles the following.

'xxx/Pxxxx/Pxxxx/Pxxxx/P............./Pxxxx
where the x's are a series of numeric values I need to pull and use for my
spreadsheet.

here's an actual sample.

'4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1 .00\P2.96\P1.00\P1.00\P0.96\P0.95\P1.99\P1.00\P1.2 1\P1.00\P1.00\P1.00\P2.10\P2.85\P2.10\P4.92\P6.50\ P2.33\P2.61\P1.00\P1.00\P1.00\P0.99\P1.00\P2.07\P3 .13\P1.00\P1.00\P1.00\P1.00\P1.00\P0.89\P2.55\P\P7 6.60\P

and the other portion of the sample is-- in its own column:

'09-120-01\P09-120-05\P09-120-15\P09-120-22\P09-120-26\P09-120-27\P09-120-28\P09-120-29\P09-120-44\P09-120-45\P09-120-46\P09-120-52\P09-120-53\P09-120-54\P09-120-56\P09-120-57\P09-131-40\P09-131-41\P09-131-42\P09-131-43\P09-131-47\P09-131-49\P09-131-50\P09-132-08\P09-132-13\P09-132-18\P09-132-19\P09-132-29\P09-132-30\P09-132-31\P09-132-34\P09-132-35\P09-132-36\P09-132-37\P09-132-38\P09-132-39\P09-132-40\P09-132-42\P09-132-43\PBasque
Ln.\PJuniper Hill Rd.\P\PTotal\P

I'm looking to extract the numbers/text and place each grouping separated by
the /P's in its own cell, in a single column. In the case of the samples
above, that'd be two columns of data.

How would I accomplish this?
Thank you.
Best.
SteveB.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default extract elements of strings

Perfect-- Gary, thank you.
Yet another satisfied customer.... ;-)

"Gary''s Student" wrote:

If A1 contains:

4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1. 00\P2.96\P1.00\P1.00

Select A1 and run this macro:

Sub steve()
v = ActiveCell.Value
s = Split(v, "\P")
For i = LBound(s) To UBound(s)
ActiveCell.Offset(i + 1, 0).Value = s(i)
Next
End Sub

Cells A2 thru A13 will contain:

4.75
5.05
0.16
5.3
1.19
1.01
1.01
1.01
1
2.96
1
1

--
Gary''s Student - gsnu200806


"SteveDB1" wrote:

Morning all.
While I've asked on this general topic before and obtained the solution I
sought, this is different in that I've now used AutoCAD 2009's dataextraction
tool and the text I chose within AutoCAD was a "multi-text."

In doing so I've found that the output into excel resembles the following.

'xxx/Pxxxx/Pxxxx/Pxxxx/P............./Pxxxx
where the x's are a series of numeric values I need to pull and use for my
spreadsheet.

here's an actual sample.

'4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1 .00\P2.96\P1.00\P1.00\P0.96\P0.95\P1.99\P1.00\P1.2 1\P1.00\P1.00\P1.00\P2.10\P2.85\P2.10\P4.92\P6.50\ P2.33\P2.61\P1.00\P1.00\P1.00\P0.99\P1.00\P2.07\P3 .13\P1.00\P1.00\P1.00\P1.00\P1.00\P0.89\P2.55\P\P7 6.60\P

and the other portion of the sample is-- in its own column:

'09-120-01\P09-120-05\P09-120-15\P09-120-22\P09-120-26\P09-120-27\P09-120-28\P09-120-29\P09-120-44\P09-120-45\P09-120-46\P09-120-52\P09-120-53\P09-120-54\P09-120-56\P09-120-57\P09-131-40\P09-131-41\P09-131-42\P09-131-43\P09-131-47\P09-131-49\P09-131-50\P09-132-08\P09-132-13\P09-132-18\P09-132-19\P09-132-29\P09-132-30\P09-132-31\P09-132-34\P09-132-35\P09-132-36\P09-132-37\P09-132-38\P09-132-39\P09-132-40\P09-132-42\P09-132-43\PBasque
Ln.\PJuniper Hill Rd.\P\PTotal\P

I'm looking to extract the numbers/text and place each grouping separated by
the /P's in its own cell, in a single column. In the case of the samples
above, that'd be two columns of data.

How would I accomplish this?
Thank you.
Best.
SteveB.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default extract elements of strings

Thanks for the feedback!
--
Gary''s Student - gsnu200806


"SteveDB1" wrote:

Perfect-- Gary, thank you.
Yet another satisfied customer.... ;-)

"Gary''s Student" wrote:

If A1 contains:

4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1. 00\P2.96\P1.00\P1.00

Select A1 and run this macro:

Sub steve()
v = ActiveCell.Value
s = Split(v, "\P")
For i = LBound(s) To UBound(s)
ActiveCell.Offset(i + 1, 0).Value = s(i)
Next
End Sub

Cells A2 thru A13 will contain:

4.75
5.05
0.16
5.3
1.19
1.01
1.01
1.01
1
2.96
1
1

--
Gary''s Student - gsnu200806


"SteveDB1" wrote:

Morning all.
While I've asked on this general topic before and obtained the solution I
sought, this is different in that I've now used AutoCAD 2009's dataextraction
tool and the text I chose within AutoCAD was a "multi-text."

In doing so I've found that the output into excel resembles the following.

'xxx/Pxxxx/Pxxxx/Pxxxx/P............./Pxxxx
where the x's are a series of numeric values I need to pull and use for my
spreadsheet.

here's an actual sample.

'4.75\P5.05\P0.16\P5.30\P1.19\P1.01\P1.01\P1.01\P1 .00\P2.96\P1.00\P1.00\P0.96\P0.95\P1.99\P1.00\P1.2 1\P1.00\P1.00\P1.00\P2.10\P2.85\P2.10\P4.92\P6.50\ P2.33\P2.61\P1.00\P1.00\P1.00\P0.99\P1.00\P2.07\P3 .13\P1.00\P1.00\P1.00\P1.00\P1.00\P0.89\P2.55\P\P7 6.60\P

and the other portion of the sample is-- in its own column:

'09-120-01\P09-120-05\P09-120-15\P09-120-22\P09-120-26\P09-120-27\P09-120-28\P09-120-29\P09-120-44\P09-120-45\P09-120-46\P09-120-52\P09-120-53\P09-120-54\P09-120-56\P09-120-57\P09-131-40\P09-131-41\P09-131-42\P09-131-43\P09-131-47\P09-131-49\P09-131-50\P09-132-08\P09-132-13\P09-132-18\P09-132-19\P09-132-29\P09-132-30\P09-132-31\P09-132-34\P09-132-35\P09-132-36\P09-132-37\P09-132-38\P09-132-39\P09-132-40\P09-132-42\P09-132-43\PBasque
Ln.\PJuniper Hill Rd.\P\PTotal\P

I'm looking to extract the numbers/text and place each grouping separated by
the /P's in its own cell, in a single column. In the case of the samples
above, that'd be two columns of data.

How would I accomplish this?
Thank you.
Best.
SteveB.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract top 5 elements from table Bob[_10_] Excel Programming 4 August 2nd 08 07:22 PM
read contents of col 1 and extract similar strings Bob Excel Discussion (Misc queries) 5 November 5th 07 11:21 PM
HOW TO EXTRACT STRINGS FROM CELLS vidhya Excel Discussion (Misc queries) 2 November 17th 05 12:40 PM
How do I find the number of elements in an Array of Strings? BeefmanSteve Excel Programming 5 June 17th 05 12:48 AM
Extract numbers from strings Stan Altshuller Excel Worksheet Functions 6 February 17th 05 09:33 PM


All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"