; Main routine simulator('spectre) base_results=strcat("/results/data/Interactive.0/") sub_dir = strcat("") TSTOP = 30e-09 init_val = 1 final_val = sim_case = init_val while( sim_case < (final_val + 1) printf("sim_case = %d\n" sim_case) sprintf(sim_case_val "%d" sim_case) ; Define unique output file for each ADE set of simulation results fname = strcat("" "_" sim_case_val ".csv") fp_params = outfile( fname "w") results = strcat( base_results sim_case_val sub_dir "psf") netlist_dir = strcat( base_results sim_case_val sub_dir "netlist") netcap_filename = strcat("netlist.info.netcap") ; Total cap appears to be 14th column of file netlist.info.netcap ; I'm not sure of the delimiter so am using a space - change this to ; the proper delimiter. I am also saving the net name which is in ; column 4 sprintf(cut_field_14_command "cut -d\" \" -f4,14") sprintf(apply_cut_command "%s > ./tempfile\n" cut_field_14_command strcat(netlist_dir "/" netcap_filename) ) sprintf(grep_net_command "grep my_net ./tempfile > %s\n" fname) system(apply_cut_command) system(grep_net_command) system("rm ./tempfile\n") close(fp_params) sim_case = sim_case + 1 ) ; end sim_case loop exit()