从一个CSV文件中获取一行以在其他CSV文件中搜索匹配行
我偶然发现了一个问题,即在CSVhelper的帮助下生成了CSV文件。该文件由2列(时间戳和ID)组成。我现在想打开一个包含这些ID的ID和说明的不同CSV文件,并将描述导入其他CSVFILE,以将ID与描述匹配。
但是,我还没有找到有关如何执行此操作的任何信息。并想知道是否有任何顺利执行此操作的方法。
编辑:
要澄清:我有一个CSV文件,其中包含与此相似的不同事件:
17/05/2022 16.28, 2
17/05/2022 16.28, 3
其中1,2,3和4表示事件发生的事件的ID。我想从其他CSV文件中获取ID的描述。看起来像这样:
1, problem 1
2, problem 2
3, problem 3
4, problem 4
所以我想获取ID 2和3的描述,然后将其插入ID旁边,以便最终结果看起来像这样:
17/05/2022 16.28, 2, problem 2
17/05/2022 16.28, 3, problem 3
I have stumbled upon a problem where i have a csv file generated with the help of CSVhelper. The file consists of 2 columns (Timestamp and ID). I would now like to open a different CSV file that contains IDs and descriptions for these IDs and import the description to the other CSVfile to match the ID with a description.
I have not however found any information on how to perform this. And wondered if there is any smooth way of performing this.
EDIT:
To clarify: I have one CSV file which contains different events which looks similar to this:
17/05/2022 16.28, 2
17/05/2022 16.28, 3
Where the 1,2,3 and 4 represents the ID of the event that has happened. I would like to fetch a description for the ID from a different CSV file. Which looks like this:
1, problem 1
2, problem 2
3, problem 3
4, problem 4
So I would like to fetch the description for the ID 2 and 3 and insert it next to the ID so the end result would look like this:
17/05/2022 16.28, 2, problem 2
17/05/2022 16.28, 3, problem 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Peter Smith有正确的主意。这样的事情应该起作用。
@Peter Smith has the right idea. Something like this should work.