|
|
|
||||
|
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 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
I have 2 text files from which i need to remove duplicates
I have 2 text files with names.
One is a big list with xxxx amount of names and the text file is a small list with xxx amount of names. The smaller list names also appear on the bigger list. Now i need a way to compare both list and remove ALL the names that appear on both lists. Know what i mean? |
|
|
|
|
|
#2 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Mar 2004
Posts: 16,116
|
get a list manager...
__________________
Your Paysite Partner Strength In Numbers! StickyDollars | RadicalCash | KennysPennies | HomegrownCash |
|
|
|
|
|
#3 |
|
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Posts: 10,592
|
__________________
![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
|
|
|
|
|
#4 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
I have list managers but they can only remove the duplicates and not the original name as well. I want any duplicate name to be gone. So it doesnt appear at all on the list anymore.
|
|
|
|
|
|
#5 |
|
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Posts: 10,592
|
SlimList will remove duplicate entries, but only the duplicate.
Are you looking to do something like this: LIST A: name1 name2 name3 name4 LIST B: name1 name5 name6 name7 ACTION: remove name1 from both lists. Is that what you're talking about? Or simply removing duplicates?
__________________
![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
|
|
|
|
|
#6 | |
|
Confirmed User
Join Date: May 2006
Location: brazil
Posts: 781
|
Quote:
cat list1.txt list2.txt |sort |uniq > list3.txt the list3.txt will contain both lists, ordered and without the dupes.
__________________
hai2u |
|
|
|
|
|
|
#7 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Mar 2004
Posts: 16,116
|
Or you could throw it in a XLS, sort and remove by hand.
__________________
Your Paysite Partner Strength In Numbers! StickyDollars | RadicalCash | KennysPennies | HomegrownCash |
|
|
|
|
|
#8 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
Quote:
|
|
|
|
|
|
|
#9 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
|
|
|
|
|
|
#10 |
|
Confirmed User
Join Date: Sep 2007
Location: Somewhere over the rainbow.... ICQ-474167022
Posts: 314
|
|
|
|
|
|
|
#11 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Confirmed User
Join Date: Aug 2006
Posts: 268
|
Code:
<?php
$list1 = file( "list1.txt" );
$list2 = file( "list2.txt" );
for( $i=0; $i<count($list2); $i++ ){
if( in_array( $list2[$i], $list1 ) ){ /* do nothing */ } else { $new_array[] = $list2[$i]; }
}
echo "<pre>";
print_r( $new_array );
echo "</pre>";
?>
|
|
|
|
|
|
#13 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
Quote:
|
|
|
|
|
|
|
#14 |
|
Confirmed User
Industry Role:
Join Date: Aug 2004
Location: Barcelona
Posts: 1,022
|
paste into excel and run a macro to remove duplicates, do a google search for excel remove dupes.
|
|
|
|