• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PERL Script Help

dfnkt

Senior member
Looking for some help with a perl script.

I need to parse a .txt file I have of our active directory user "Display Names". The list contains approximately 6,000 names, trying to get a perl script that can read the list one by one and print the display name only if it contains a space.

for example:
user1
user2
John Doe
user3
Jane Doe

In the above example the script should print John Doe and Jane Doe while skipping the users that have no space.

The reasoning behind this is that we have a ton (probably 2,500 or more) "novelty/service" accounts that are not real users.

I tried defining all the users in the script such as @adusers = qw(insert users here) and then doing a $_ = /\s/; regex but to no avail.
 
Bah, you want short use grep:

grep ' ' test.txt (non-robust)
grep '\w \w' test.txt (more robust)
 
Back
Top