main function - outputs in following format BEFORE consolidation (which is TODO)
    # filename,         word,           linenumbers
    # refAction.csv,    ActionTypeName, 1
    # refAction.csv,    PhysicalType,   1
    # goals.csv,        Cleanliness,    11

def index():
    """
    main function - outputs in following format BEFORE consolidation (which is TODO)
    # filename,         word,           linenumbers
    # refAction.csv,    ActionTypeName, 1
    # refAction.csv,    PhysicalType,   1
    # goals.csv,        Cleanliness,    11
    """
    lg = mod_log.Log(mod_cfg.fldrs['localPath'])
    lg.record_command('Starting indexing',  'index.py') # sys.modules[self.__module__].__file__)
    if silent == 'N':
        print('------------------')
        print('Rebuilding Indexes')
        print('------------------') 

    with open(ndxFile, "w") as ndx:
        ndx.write('filename, word, linenumbers\n')

    files_to_index = mod_fl.FileList([mod_cfg.fldrs['public_data_path'] + os.sep + 'core'], ['*.csv'], ignore_files, "files_to_index_filelist.csv")
    
    
    if silent == 'N':
        print(format_op_hdr())
        
    for f in files_to_index.get_list():
        buildIndex(f, ndxFile, silent)
    
    # now build the one big index file
    consolidate(ndxFile, opIndex )

    lg.record_command('Finished indexing',  'index.py')   #, fle.GetModuleName())
    if silent == 'N':
        print('Done')