我有一个.txt
文件,列出了一些用户名。
喜欢:
User1
User2
User3
我还有一个.txt
文件,其中包含一些相同的用户名以及其他信息:
User1 - user1@txt.com - 12341515 - yes
User2 - user2@txt.com - 13134141 - no
如何从第一个文件中搜索第二个文件中的用户,然后在新的 txt 文件中输出第二个文件的完整行。
我试过 , Get-content
and |where-object
,但我不知道如何准确搜索。
这些文件没有标题。
更新
file1,我要查找的用户在哪里是这样的
u16096
原始文件2,所有用户信息都具有此顺序。
u16096 Y NAME SURNAME name.surname@what.com 12345678