<filename>map_crawling/map_crawling_code/address_motify.py
import re 
import csv
 
def mo(csv_file):
    #f = open(str(csv_file), "r")
    f = open(csv_file, "r")
    first_line = f.readline() #把檔頭讀掉   
    rows = csv.reader(f)

    # 以迴圈輸出每一列
    final = []
    for row in rows:
        add = row[2]
    
        if "," in add:
            add = "無提供地址資訊"

        a = re.findall(r'[0-9]+|[a-z]+',add)
        try:
            n_line = add.replace(str(a[0]), "")
            final.append(n_line)
        except:
            final.append(add)
    return final

inp = mo("/Users/linyumei/Ramen_May_git/map_crawling/csv_file/Map_Ramen_data_new_version.csv")

for item in inp:
    print(item)
    



    

<filename>map_crawling/map_crawling_code/address_motify.py
import re 
import csv
 
def mo(csv_file):
    #f = open(str(csv_file), "r")
    f = open(csv_file, "r")
    first_line = f.readline() #把檔頭讀掉   
    rows = csv.reader(f)

    # 以迴圈輸出每一列
    final = []
    for row in rows:
        add = row[2]
    
        if "," in add:
            add = "無提供地址資訊"

        a = re.findall(r'[0-9]+|[a-z]+',add)
        try:
            n_line = add.replace(str(a[0]), "")
            final.append(n_line)
        except:
            final.append(add)
    return final

inp = mo("/Users/linyumei/Ramen_May_git/map_crawling/csv_file/Map_Ramen_data_new_version.csv")

for item in inp:
    print(item)
    



    

#f = open(str(csv_file), "r") #把檔頭讀掉 # 以迴圈輸出每一列