cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Filter and extract data from a table

BPP
7-Bedrock
7-Bedrock

Filter and extract data from a table

Hi to all

I have a table (table_data) that contains a large number of rows in which the coordinates of X, Y and Z of several objects named POLYLINE and LWPOLYLINE are found.
I need to extract the values of those coordinates, sort them in a table and indicate which belong to one object and which belong to the other.

To better understand what I want, I attached an example of what I want to do automatically, since I do it manually and it takes a lot of time.

In advance thanks for the help

1 ACCEPTED SOLUTION

Accepted Solutions

Here is a quick hack, assuming a well behaved data file (sorted, consistently formatted, ...as mentioned above) and without error checking, etc.

Bild1.png

Bild2.png

View solution in original post

11 REPLIES 11
ValeryOchkov
24-Ruby IV
(To:BPP)

Filter.png

Prime

FilterPrime-2.png

Werner_E
24-Ruby V
(To:BPP)


@BPP wrote:

Hi to all

I have a table (table_data) that contains a large number of rows in which the coordinates of X, Y and Z of several objects named POLYLINE and LWPOLYLINE are found.
I need to extract the values of those coordinates, sort them in a table and indicate which belong to one object and which belong to the other.

To better understand what I want, I attached an example of what I want to do automatically, since I do it manually and it takes a lot of time.


Hmm, it would also take some time to write the little parser you need and you would need some additionals informations like

.) are POLYLINE and LWPOLYLINE the only identifiers for objects?

.) Your write that you need to sort the data and indicate which belong to which object. Does that mean that the source data may be not sorted like the one you provided? Can it be that the points are scattered throughout the file and we have to look at the "VERTEX    Layer: " ????" " label for each set of coordinates to see which object that point belongs to.
.) is it for sure that every line with coordinates has the text "at point" in front?

.) can you guarantee that after "X=" etc. the number takes always up exactly 9 characters? Or can you run into a file with more or less precision, too? A fix number would make parsing easier of course.

....

 

@ValeryOchkov

Sorry Valery, but I really don't see how your two answers (with the way to huge pics IMHO) relate to the question and could help. Anything I am missing?

Here is a quick hack, assuming a well behaved data file (sorted, consistently formatted, ...as mentioned above) and without error checking, etc.

Bild1.png

Bild2.png

WernerExinger wrote:

Level 20

>Sorry Valery, but I really don't see how your two answers (with the way to huge pics IMHO) relate to the question and could help. Anything I am missing?

I do not myself. Ask please BPP!


@ValeryOchkov wrote:

WernerExinger wrote:

Level 20

>Sorry Valery, but I really don't see how your two answers (with the way to huge pics IMHO) relate to the question and could help. Anything I am missing?

I do not myself. Ask please BPP!


???

Guess he sure can't know what YOU had in mind with you answers 😉

I could not find any clue in your answers for writing the parser needed by BPP, so I asked you about it, as it could very easily be that I am overlooking something important in your answers.

Am I correct that it was just the subject " Filter and extract data from a table" which triggered your reply?


@Werner_E wrote:

@ValeryOchkov wrote:

WernerExinger wrote:

Level 20

>Sorry Valery, but I really don't see how your two answers (with the way to huge pics IMHO) relate to the question and could help. Anything I am missing?

I do not myself. Ask please BPP!


???

Guess he sure can't know what YOU had in mind with you answers 😉

I could not find any clue in your answers for writing the parser needed by BPP, so I asked you about it, as it could very easily be that I am overlooking something important in your answers.

Am I correct that it was just the subject " Filter and extract data from a table" which triggered your reply?


Sorry, Werner!

Is all your answer useful?




Sorry, Werner!

Is all your answer useful?


No need for being upset.

I hope that my main answer will be helpful for BPP.

My appendix question to you, as already written, originated in an uncertainty on my part, whether I might have overlooked something. Now I guess I haven't.

BPP
7-Bedrock
7-Bedrock
(To:Werner_E)

Thank you very much to both.
The algorithm developed by Valery is very useful, since it does exactly what the title indicates, it filters data from a mother matrix. Without a doubt, it will be very useful for me.

As for Werner's questions, POLYLINE and LWPOLYLINE are not the only object identifiers, but the source data will always be in the order shown. I made some modifications to your algorithm and it works very well.
Thank you very much.

ValeryOchkov
24-Ruby IV
(To:BPP)

You welcome, BPP!


@Werner_E wrote:

@ValeryOchkov

Sorry Valery, but I really don't see how your two answers (with the way to huge pics IMHO) relate to the question and could help. Anything I am missing?


Sorry, Werner, - You are missing!

The answer from BPP was:

The algorithm developed by Valery is very useful, since it does exactly what the title indicates, it filters data from a mother matrix. Without a doubt, it will be very useful for me.

Top Tags