Apr-01-2018, 02:05 PM
Hi experts..
I have a program like below
1. I have hardcoded values for value_matrix above..instead I have a csv file which has around 340 rows , instead of hardcoding these into program , i need to read that file and store all rows in the value_matrix
2. now once we have all 340 rows are written into matrix, I want to pass SERVICE NAME which is first field in csv i.e in above example code accommodation as run time paramater so that it will output only that row...
can you please suggest how can i modify this program...
Best Regards
ASP
I have a program like below
import pytablewriter writer = pytablewriter.MarkdownTableWriter() writer.table_name = "example_table" writer.header_list = ["SERVICE NAME", "TEAM NAME", "CI OWNER", "SECONDARY CONTACT", "PAYCHECK NAME", "DEV", "DEVII","QA", "STAGE", "PROD", "PROD"] writer.value_matrix = [ ["accommodation", "POSE", "Donker","Khavarian","Acc", "Yes", "Yes", "Yes","Yes","Yes","Yes"], ["activity-entity", "Reg","Chang", "John", "TER", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes"], ] writer.write_table()This works well.. but my requirment is
1. I have hardcoded values for value_matrix above..instead I have a csv file which has around 340 rows , instead of hardcoding these into program , i need to read that file and store all rows in the value_matrix
2. now once we have all 340 rows are written into matrix, I want to pass SERVICE NAME which is first field in csv i.e in above example code accommodation as run time paramater so that it will output only that row...
can you please suggest how can i modify this program...
Best Regards
ASP