我有一个很大的CSV文件(5Go)。标题是:
run number,export,downerQ,coefUpQuality,chooseMode,demandF,nbPLots,standarDevPop,nbCitys,whatWord,priceMaxWineF,marketColor,[step],giniIndexReserve,giniIndexPatch,meanQualityTotal,meanQualityMountain,meanQualityPlain,DiffExtCentral,nbcentralPlots,meanPatchByNetwork,sum_q_viti_moutain,sum_q_viti_plaine
"3","false","0.5","0.01","false","7000","10","2","10","0","70","false","0","0","0.07083333333333335","0","0","0","0","0","0","48","0"
"4","false","0.5","0.01","false","7000","10","2","10","0","70","false","0","0","0.04285714285714286","0","0","0","0","0","0","42","0"
"2","false","0.5","0.01","false","7000","10","2","10","0","70","false","0","0","0.05348837209302328","0","0","0","0","0","0","43","0"
我想只保留包含" 500"在现场[步骤](第十三场)。
是否有人使用sed
,awk
或任何其他命令等工具获得解决方案?
答案 0 :(得分:4)
awk似乎要走了:
awk -F, 'NR == 1 || $13 == "\"500\""' filename
NR == 1
保留第一行(标题)的位置,之后只有第13个字段为"500"
的行。