FlowHeater - The Data Import / Export Specialist
See also the general examples available, which may answer your question: Hello World 1 / 2 / 3 , format numbers as character strings , simple If-Then-Else , complex If-Then-ElseIf , filtering and grouping data , consolidate grouped values

Address split into streetname and number

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
4 years 2 months ago #3489 by FlowHeater-Team
Address split into streetname and number was created by FlowHeater-Team
Hey guys,

What i need to do is write from an Access database to a MySql database. my issue is in the address line. i need to split the streetname and number, but there is no clear indication of where i can split the address.

For example:
Schmiedestr. 13 - 15
Im Gewerbepark 26-30
Küferstr. 10 a
Schützenhofstr. 113 a

I can't find a clear place tosplit it and i can find a way to filter it out. Maybe you guys have seen this issue before and know how to bypass it.

Thanks in advance guys!

Kind regards,
Jonas
Request received via email

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

  • FlowHeater-Team
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
4 years 2 months ago #3490 by FlowHeater-Team
Replied by FlowHeater-Team on topic Address split into streetname and number
Hi Jonas,

For this special topic, you need the help of the .NET Script Heater and thelittle script below. The script search for the first number position in the street name. If a number was found the script adds a delimiter in the street name, for example -#-

Afterwards you can split this with the delimiter extended street name withthe String Split Heater into two separate parts. You´ll find an example
attached.

C# script
Code:
string delimiter = "-#-"; public object DoWork() {   if (InValues.Length != 1)     throw new Exception("one input parameter expected!");   // access the first input parameter   string val = (string)InValues[0].GetString();   // find the position of the first numeric character   int pos = val.IndexOfAny(new char [] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'});   if (pos > 0)   {     string street = val.Substring(0, pos);     string number = val.Substring(pos);     val = street + delimiter + number;   }   else     val += delimiter;     return val; }

File Attachment:

File Name: address-split.zip
File Size:2 KB

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #3491 by Jonas Boudewijns
Replied by Jonas Boudewijns on topic Address split into streetname and number
Works like a charm, thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.404 seconds

other Languages

de

FlowHeater Home

de en

Imprint/Contact

Privacy Statement

Copyright © 2009-2023 by FlowHeater GmbH.
All rights reserved.

Follow us on

twitter  facebook

YouTube

 de en