scripts/update_filter_lists.py
def copy_to_sorted_mmsi(source_path, dest_path):
    """
    Drop header (1st row) and sort then dump to dest_path
    """
    lines = []
    with open(source_path) as source:
        for i, l in enumerate(source.readlines()):
            l = l.strip()
            if i < 1 or not l:
                continue
            lines.append(l)     
    lines = sorted(set(lines)) 
    lines.sort()  
    with open(dest_path, "w") as dest:
        dest.write('\n'.join(lines))

    Drop header (1st row) and sort then dump to dest_path
    
Drop header (1st row) and sort then dump to dest_path
Drop header ( 1st row ) and sort then dump to dest_path
def copy_to_sorted_mmsi(source_path, dest_path):
    lines = []
    with open(source_path) as source:
        for i, l in enumerate(source.readlines()):
            l = l.strip()
            if i < 1 or not l:
                continue
            lines.append(l)     
    lines = sorted(set(lines)) 
    lines.sort()  
    with open(dest_path, "w") as dest:
        dest.write('\n'.join(lines))
def copy_to_sorted_mmsi ( source_path , dest_path ) : lines = [ ] with open ( source_path ) as source : for i , l in enumerate ( source . readlines ( ) ) : l = l . strip ( ) if i < 1 or not l : continue lines . append ( l ) lines = sorted ( set ( lines ) ) lines . sort ( ) with open ( dest_path , "w" ) as dest : dest . write ( '\n' . join ( lines ) )
Drop header (1st row) and sort then dump to dest_path
Drop header ( 1st row ) and sort then dump to dest_path
"""
    Drop header (1st row) and sort then dump to dest_path
    """
source_path
dest_path