我在這里有一個合乎邏輯的問題。我需要為每個用戶打印一個格式為“[email protected] [email protected]”的字符串,其業務名稱和經理適合組 CSV 中的業務標題,部門和經理。如果有多個匹配組,則字符串應按上述方式打印,但應與另一個組一起打印。這里最好的方法是什么?從兩個CSV文件創建數組,然后在循環中執行if?例集團簡歷:Group,Job title,Department,Manager (email address)[email protected],Senior Sales Manager,Sales,[email protected]@dundermifflin.com,Senior Sales Manager,Sales,[email protected]用戶:First name,Last name,Location,Start date,Job title,Department,Manager (email address)Jim,Halpert,Scranton,7/1/2021,Senior Sales Manager,Sales,[email protected],Schrute,Scranton,7/1/2021,Assistant to the Regional Manager,Sales,[email protected]我希望有如下輸出:[jim.halpert@[email protected] [email protected]][jim.halpert@[email protected] [email protected]]目前我有這個var match [][]string for _, u := range userRows { for _, g := range groupRows { if u[0] == g[0] { match = append(match, string{g, u}) } } }但我不確定這里可能出了什么問題(字符串{g, u})
添加回答
舉報
0/150
提交
取消