How is it possible to define a string, after which everything else in a cell should be removed?
Hi @JulianK98 , depending on the pattern that you see in all the rows, youāll have to use āCell Splitterā Node, āCell Splitter by Positionā Node, or āString Manipulationā Node (using its āsubstrā formula) followed by Column Filter Node.
Youād have to upload a sample of data if youāre not sure how, so people here can help.
Hi, thank you!
Unfortunately I really donāt know how.
Hereās a sample. I would like to remove everything except āStadt Leverkusenā and āStadt Marlā in this List.
Test1.xlsx (9.0 KB)
Solution Stripping.knwf (41.8 KB)
Iām sure others can do it way simpler than what I did here; please find the solution as attached.
Update: Sorry when I re-read your question, you want to extract only the first two words right? Give me a few minutes to re-do the workflow, cause the one I sent was the opposite of what you wanted.
Solution Stripping.knwf (47.2 KB)
Hereās the updated solution.
What you seek is either in the output of the last Node (i.e. Duplicate Row Filter), or in the output of the second last Node (Concatenate), depending on the final form of the extract that you want. @JulianK98
Oh thank you very much, that works here! But what if the original sheet is way longer and there are several parts like these. And in between there are also parts of the list which can stay the same. Then this Partitioning Nod wonāt work, right?
By āway longerā, your concern is that thereāll be more variations of the first two words other than merely āStadt Leverkusenā and āStadt Marlā right?
And can you clarify on what you meant by āparts of the list which can stay the sameā?
I can adjust the workflow for the first concern using GroupBy Node.
Also, can you inform me what the final form of the extract you would like to see? (e.g. Is the end goal is to extract the names of the cities mentioned in the whole database?)
Hereās an example about how the real sheet I have to reorganize looks like. (Itās about German cities and public organizations of the cities btw)
In the end I want just the city names in the list (like Stadt Marl, Stadt Leverkusen etc). As you can see, there are some rows in which are already just the names of a city (rows 11,12,23).
So these rows can stay the same.
And for the other parts I have to delete all the stuff behind the city name.
So I would have to execute your workflow for specific parts of the list (row 1-10, row 13-22, row 24-27ā¦). And that wonāt work simply with the Partitioning Nod?
Test1.xlsx (9.1 KB)
Hi @JulianK98 ,
Stadt Workflow.knwf (27.1 KB)
For the new dataset file you shared, hereās the solution to your end goal.
This works following two conditions:
- Each row of your dataset begins with the two words following the same pattern of Stadt + X.
- There is no other characters (including spaces) before the first word (Stadt).
Additional note:
-
X = name of the city
-
If X is a two-word city name, that name should be hyphenated. (Iām not saying Baden-Württemberg is a city, but letās assume it is for the sake of argument, itās a good example of a hyphenated compound word that will work for my Solution).
-
If X contains an umlaut like Kƶln, make sure all of Kƶln variants are consistent, as opposed to Koeln, for example. Inconsistency of spellings & umlauts will lead to inaccurate duplicates in the final result.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.