Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ADVANCED data strippping

I am currently working with a CNC program. I am trying to extract all
the X Y Z and B position information from it. the data is just lines
of code like so contained in the first column.


G01 Z-106. F1000.
X120.021 Y-144.343 F50.0
G03 X119.179 Y-142.257 I-0.421 J1.043

what i want to do is make 4 columns to the right of the program labeled
X Y Z B. In those columns i want the numbers that are called out by
these letters. for instance the 3 lines of code above would
output....

X Y Z B
-106
120.021 -144.343
119.179 -142.257


If there is no value i would like to leave the cell blank.
If there is a X Y Z or B in the cell I want the number after it
outputted to the cell. the numbers only go to 3 decimal places. I
imagine I would need one formula for each column, one to look for each
letter. I am pretty good in excel but i have no idea where to begin.

Attachment filename: op10.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=430138
---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default ADVANCED data strippping

The VBA InStr function in conjunction with the Split function is the way to
go.
To many if's for a worksheet formula for my taste.
If you have a X value but no Y value how do you know where the X value ends?
You can test for the end of the string, but then you also have to test for
Y, Z & B and blanks.
Not to mention all those comments.

Now if the code had spaces between the values and letters you could just do
a text to columns...

EditReplace X with X[space]
Y with Y[space]
Z with Z[space]
B with B[space]
Hummmm..?


--
John
johnf 202 at hotmail dot com


"rstevens5l " wrote in message
...
| I am currently working with a CNC program. I am trying to extract all
| the X Y Z and B position information from it. the data is just lines
| of code like so contained in the first column.
|
|
| G01 Z-106. F1000.
| X120.021 Y-144.343 F50.0
| G03 X119.179 Y-142.257 I-0.421 J1.043
|
| what i want to do is make 4 columns to the right of the program labeled
| X Y Z B. In those columns i want the numbers that are called out by
| these letters. for instance the 3 lines of code above would
| output....
|
| X Y Z B
| -106
| 120.021 -144.343
| 119.179 -142.257
|
|
| If there is no value i would like to leave the cell blank.
| If there is a X Y Z or B in the cell I want the number after it
| outputted to the cell. the numbers only go to 3 decimal places. I
| imagine I would need one formula for each column, one to look for each
| letter. I am pretty good in excel but i have no idea where to begin.
|
| Attachment filename: op10.xls
| Download attachment:
http://www.excelforum.com/attachment.php?postid=430138
| ---
| Message posted from http://www.ExcelForum.com/
|


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
Advanced Data Filter Asad Excel Worksheet Functions 1 April 29th 10 08:39 AM
Data changes in advanced filter David Sher[_2_] Excel Worksheet Functions 2 February 3rd 10 03:50 PM
Advanced Conditional Formatting Ideas Needed! (ok, maybe not that advanced...) shadestreet Excel Discussion (Misc queries) 2 July 21st 06 03:04 PM
Advanced Data Validation [email protected] Excel Discussion (Misc queries) 2 October 22nd 05 01:47 PM
why can't i use the advanced filter on my data pinta Excel Discussion (Misc queries) 2 September 3rd 05 06:41 PM


All times are GMT +1. The time now is 01:23 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"