Do you ever face the tedious task of managing address lists from various countries like Japan, the USA, and the UK in Google Sheets, wishing you could easily separate them by country, state, or city?
This article introduces "AddressParserLibrary," a Google Apps Script library that automates this data cleaning and parsing process with a single click.
Once you add the library, anyone can easily implement address parsing by making minor adjustments to the provided sample code. We will walk through everything from setup to execution in a step-by-step guide that is clear even for those unfamiliar with programming. Start boosting your daily productivity today!
AddressParserLibrary is a Google Apps Script library designed to parse address strings in a Google Sheet into their constituent parts, such as country, city, and postal code. It processes a specified column of addresses in bulk and outputs the results starting from a designated column.
Currently, the library supports the following address formats:
AddressParserLibrary
1J2Vy9PJ1d3f2DvvHfbDUJz3j3XPcDZVOlGVnoJ37pUYqZ68wHaVZCysb
parseAddresses(sheetName, inputColumn, startRow, outputColumn)
Parses the address data in a specified sheet and outputs the results to the same sheet.
+
icon next to "Libraries."1J2Vy9PJ1d3f2DvvHfbDUJz3j3XPcDZVOlGVnoJ37pUYqZ68wHaVZCysb
AddressParserLibrary
(you can change it if needed).
Write a script to call the library's function.
You can copy and paste the following function into the script editor to get started.
JavaScript
/** * A sample function to parse addresses in a spreadsheet. */
function parseMyAddresses() {
// --- Parameters ---
const sheetName = 'sheet1';
// The name of the sheet containing the addresses
const inputColumn = 'A';
// The column where addresses are located
const startRow = 2;
// The row where the data begins (assuming row 1 is a header)
const outputColumn = 'C';
// The column where the output will start
// Execute the library
function const success = AddressParserLibrary.parseAddresses(sheetName, inputColumn, startRow, outputColumn);
// Log the result of the execution
if (success) {
console.log('Address parsing complete.');
} else {
console.log('An error occurred during the process.'); }}
sheet1
, starting from the second row.parseMyAddresses
function, the addresses from column A are parsed, and the results (country, city, postal code, etc.) are outputted into columns C, D, E, and so on.
We can customize this sample to match your specific business requirements.
Book Free ConsultationThe Department Classification Library is an AI-powered automatic classification tool that runs in the Google Apps Script environment. It uses ChatGPT or Gemini to automatically classify company department names into predefined business segments.
This module is designed to visually showcase the features of a product or service by arranging images and text in an alternating layout. It uses scroll-triggered animations to engage users.
Learn how to implement a custom "Animated Counter" module in HubSpot to visually highlight your company's achievements and KPIs. This guide provides the complete HTML, CSS, JavaScript, and field configuration, allowing you to create a module that is intuitive even for non-developers.
This guide explains how to use "PhoneFormatter," a convenient Google Apps Script (GAS) library that allows you to batch-format international phone numbers in a Google Sheet. Easily convert numbers into their proper, hyphenated format simply by providing a country name in English, Japanese, or even abbreviated form.
Do you ever face the tedious task of managing address lists from various countries like Japan, the USA, and the UK in Google Sheets, wishing you could easily separate them by country, state, or city?
This article introduces "AddressParserLibrary," a Google Apps Script library that automates this data cleaning and parsing process with a single click.
Once you add the library, anyone can easily implement address parsing by making minor adjustments to the provided sample code. We will walk through everything from setup to execution in a step-by-step guide that is clear even for those unfamiliar with programming. Start boosting your daily productivity today!