![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Join Date: May 2002
Location: Nassau,Bahamas
Posts: 2,326
|
linux gurus
hey..i have a question for all you linux gurus out there..i have a small list of usernames and passwords..i want to extract the usernames only and put them into a seperate text file
the file looks like this [email protected]:password [email protected]:password2 i want to extract the #@test.com's,...how can i do this...im not new to linux just haven't used it in awhile ![]() thanks |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
(felis madjewicus)
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
|
write a quick perl script that'll extract all the emails. can't remember the name of the module that extracts emails of the top of my head. but if you search cpan you should find it easily enough. a little goolging should turn up smple code that'll perform the task. seems like a pretty common task to perform.
try this perl -wne'while(/[\w\.]+@[\w\.]+/g){print "$&\n"}' test.txt |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So Fucking Banned
Join Date: May 2002
Location: Nassau,Bahamas
Posts: 2,326
|
well i think i found something with grep, i don't think i even got perl installed on this box it'd be too much hassle, i'll post back with my results soon enough....
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Join Date: May 2002
Location: Nassau,Bahamas
Posts: 2,326
|
cut -d ':' -f 1 accounts.txt > accounts2.txt
easiest way i've found.... ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: My High Horse
Posts: 6,334
|
yup thats the right way to do it.
__________________
Mike South It's No wonder I took up drugs and alcohol, it's the only way I could dumb myself down enough to cope with the morons in this biz. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: My High Horse
Posts: 6,334
|
yup thats the right way to do it. cept you should probably use >> accounts2.txt lest you overwrite it every line dont remember how cut parses for that but >> would work either way long as ya dont run it more than once
__________________
Mike South It's No wonder I took up drugs and alcohol, it's the only way I could dumb myself down enough to cope with the morons in this biz. |
![]() |
![]() ![]() ![]() ![]() ![]() |