我有很多的大*将该.cvs文本文件看起来像这样:AWK文本处理CVS文件
Word,Tag,Lemma
Off,aa,off
short,aa,short
and,sfg3eþ,and
tall,sþghen,tall
deers,aþ,deer
in,never,in
Africa,nc,Africa
frv.,aa,frv.
---,ta,---
,,
All,nhfn,all
allowed,lhfnsf,allow
personell,c,personell
aggr.,lheþsf,aggr.
with,aþ,with
23,ta,23
as.,nvfn,as.
sillable.,lheþsf,sillable.
,,
Á,aþ,á
我需要处理该文件,使得第一列放在像列表这样的:
{[Off short and tall deers in Africa frv],[All allowed personnel aggr. with 23 as syllable.],[Á......],...n]}
在最后,需要有一个:]}
我曾尝试:
awk 'BEGIN {FS=",";print"{["} /",,"/ {print"],["} END {print"]}"}' 079.cvs
刚刚打印: {[ ]}
我也发现了这一点:
cat 080.csv | cut -d ',' -f3 >>D.txt
这实际上是非常有用的:
Off
short
and
tall
....
但实际上是 “深”文件并缺少列表元素。
这不是很好的取消接受的答案,能删除你的问题。如果你使用我的帮助,请保持礼貌。看到你删除的问题:[制作数字序列](https://stackoverflow.com/q/36344915/1983854)。 – fedorqui