我有一个 csv 列表,我想导入到谷歌。我在这里从谷歌下载了基本示例:cat contacts.csv
Name,Given Name,Additional Name,Family Name,Yomi Name,Given Name Yomi,Additional Name Yomi,Family Name Yomi,Name Prefix,Name Suffix,Initials,Nickname,Short Name,Maiden Name,Birthday,Gender,Location,Billing Information,Directory Server,Mileage,Occupation,Hobby,Sensitivity,Priority,Subject,Notes,Language,Photo,Group Membership,E-mail 1 - Type,E-mail 1 - Value,Phone 1 - Type,Phone 1 - Value,Phone 2 - Type,Phone 2 - Value
A Name,A,,Name,,,,,,,,,,,,,,,,,,,,,,,,,* myContacts,* ,[email protected],Mobile,+number,Versão antiga,+number
然后我有一个列表:
name 1,email 1,49292304
name 2,email,3943984338
...
我制作了以下 awk 命令:
awk -F "," {'sub("\r$", ""); print $1",,,,,,,,,,,,,,,,,,,,,,,,,,,,,," $2",",","$3","","'} alunos.csv
它为我生成了一个正确的 CSV,它似乎与谷歌提供给我的示例一致,但我在导入时间上有错误。我错过了什么?
将标题行添加到 CSV。