FlowHeater Demo Video
 
FlowHeater - The Data Import / Export Specialist
 
Welcome, Guest
Username: Password: Remember me
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
  • Page:
  • 1

TOPIC: Address split into streetname and number

Address split into streetname and number 7 months 2 weeks ago #3489

  • FlowHeater-Team
  • FlowHeater-Team's Avatar Topic Author
  • Offline
  • Posts: 319
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.

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.

Address split into streetname and number 7 months 2 weeks ago #3490

  • FlowHeater-Team
  • FlowHeater-Team's Avatar Topic Author
  • Offline
  • Posts: 319
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
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.

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.

Address split into streetname and number 7 months 1 week ago #3491

Works like a charm, thank you!

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

  • Page:
  • 1

other Languages

de

FlowHeater Home

de en

Imprint/Contact

Privacy Statement

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

Follow us on

twitter  facebook

YouTube

 de en