The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
Please vote in the Forum Structure Poll. Polling will close at 2PM EST on January 21, 2025.
I'm having trouble with some text sorting. I have two text files, file1 and file2. Each file is lines made u of a word, a space, and another word. file2 contains a subset of file1, but in a different order. Is there a program that can sort the entries in file2 to match the order of file1? Or just delete every entry in file1 that does not also appear in file2? Or if I sort them and use comm to get a list of the matching entries is there a way I can delete every entry in file1 that is not one of those matching entries? Should I just write a python script to dump both files to lists and iterate each file1 entry through all file2 entries and write the matches to a new file?
Should I just write a python script to dump both files to lists and iterate each file1 entry through all file2 entries and write the matches to a new file?
This is what I would do, except use sets instead of lists if you care about efficiency. That assumes that each word appears only once in each file though, and that you don't care about the order of the words in the new file.
Posts
heres a program i whiped up for you, u can just compile it, or u can hit me up for the exe
You could still do it in excel. I wouldn't though and would use python or c or whatever language you are most comfortable with.