导入-CSV 并搜索结果 [英] Import-CSV and search the results

查看:38
本文介绍了导入-CSV 并搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想导入一个包含两列(用户名、日期)的 CSV 文件.

I want to import a CSV file with two columns (username, date).

我想搜索一个特定的字符串(用户)并让它返回存储在它旁边列中的那个用户的日期.

I want to search for a specific string (user) and have it return the date of that user that is stored in the column next to it.

非常感谢.

推荐答案

应该这样做:

$csv = Import-Csv C:\test.csv
$csv | where {$_.username -eq "Tim"} | % date

这篇关于导入-CSV 并搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆