I am trying to create a generic filter to split file on the condition from the Yaml file.

My code is running Pandas but as the environment is not having Pandas module I am trying to achieve it through CSV library.

When I am hard coding the value at q its working but when I am trying to pass it from the config file its not working. Also I want pass multiple checks on the same column like('','Balance). So `Asset` goest to one file and `('','Balance)` in another.

```
import sys
import yaml
import csv

def dynamicQuery(config_file, data_file, outputPath):
    """Loading Configuration file into dataframe"""
    try:
        with open(config_file) as file:
            doc = yaml.full_load(file)

    except Exception as err:
        print("Error Configuration data file: ", err)

    try:

    for k, v in doc.items():
        if k != 'column':
            filename = k
            k = doc[k]
            q = ' , '.join(f'{v} ' for q, v in k.items())

            q = '"' + str(strip(q)) + '"'
            print(q) #-- "Asset"
            df = csv.reader(open(data_file), delimiter=',')
            df = filter(lambda x: (x[2] == q), df) # Not working here
            #df = filter(lambda x: x[2] == "Asset", df) --> this is working

            csv.writer(open(filename + ".txt", 'w', newline=' '), delimiter=',').writerows(df)
            print("File is created for " + filename)

    except Exception as err:
        print("Error executing queries and saving output data file: ", err)

def main():
    if len(sys.argv) == 3:
        """File will be passed as parameter """
        config_file = sys.argv[1]
        data_file = sys.argv[2]

        dynamicQuery(config_file, data_file)
    else:
        usage()

def usage():
    print("Usage: python splitGenric.py config_file data_file ")

main()

```

Sample file 

```
1233,ACV,Asset,sample
1235,ACV,Asset,sample
1232,ACV,Asset,sample
1234,ACV,Asset,sample
1237,ACV,,sample
1238,ACV,,sample
1234,ACV,Balance,sample
1254,ACV,Balance,sample
1244,ACV,Balance,sample
1264,ACV,Balance,sample

```

Config.yaml

```
Asset :
  filter1: '"Asset"'

Balance:
    filter1: '"Balance"'
    filter2: '""'

```