Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need script - Will pay!

    Hi guys,

    I've came to a problem, I have my members details in two .txt files.

    1.txt and 2.txt

    1.txt containing there name and 2.txt containing there address.

    Each line in the txt file ends with there 13 digit membership number.

    So what I've been doing is copying the membership number from 1.txt and searching 2.txt to match the name to the correct address.

    I need some sort of script in which i can paste all membership numbers 1 per line and combine the lines together. For example:

    I list the membership numbers.
    I load 1.txt and 2.txt

    123456789 being the first membership number to process.

    Joe Soap 123456789 is found in 1.txt
    11 Bubble Bath Lane 12356789 is found in 2.txt

    Output.txt -> Joe Soap 123456789 11 Bubble Bath Lane 12356789


    If anyone has the idea of what i need done here and your capable of doing it, im willing to pay for this sort of script.

    It doesnt need to be in PHP

    I can't do this manually since there is thousands.

    Please reply with your skype/msn/messenger if you can do this we will talk about a price.

  • #2
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    I've got a deal for you...

    Paste a 3 line extract from both the files in here and I'll write you a script to do it and paste in in here for you.

    Once you have the script and tested it and extracted all your data you can pay me $5

    How's that?

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "id","members name","access code","expiration","pin","173920"
    "id","members name","access code","expiration","pin","628419"
    "id","members name","access code","expiration","pin","704241"

    "address","city","state","","zip","077315"
    "address","city","state","","zip","238403"
    "address","city","state","","zip","222709"

    I have edited out confidential information and replaced with field names..
    As you can see the end numbers are the membership numbers, both files contain those at the end of each line, i need the ones that match to be combined/merged into one line and put into an output file

    So it would come out like this:

    "id","members name","access code","expiration","pin","704241" "address","city","state","","zip","704241"



    If you can do the script i require, I'll pay you 25x $5
    Last edited by JobNeedsDone; 05-20-2012 at 05:40 AM.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I can do this for you. I have sent you a PM. What do you want to happen if there isn't a match?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    @jobsneedsdone - just got back and starting on this for you now. Will post the code here for you within 30 minutes.....

  • #6
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    OK, this script below should do the job that is assuming the following:

    1 - the files with content are exactly as you have describe with no other header lines or anything out of place
    2 - the file are readable and in the same drectory as this script
    3 - you hold your mouth at just the right angle when pushing the button

    anyway... this is a first test... let me know how it goes.

    PHP Code:
    <?php
    /*
    put this script in the same directory as the two files and put the file names in below.
    */
    // enter the file names here
    $file1 'file-1.txt';
    $file2 'file-2.txt';

    $data1 filetoarray($file1,6);   // you can actually specify the column the id is in if it's different in each file... although it seems to be the same from your dataset extract... at column 6
    $data2 filetoarray($file2,6);

    // now loop through one of the datasets and match the keys with the other
    // build the keys list
    $dataSetKeys array_keys($data1);
    // loop through the keys and build the results
    $j count($dataSetKeys);
    for(
    $i 0$i $j$i++){
        
    $thisKey $dataSetKeys[$i];
        if(isset(
    $data2[$thisKey])){
            echo 
    $data1[$thisKey][0].','.$data1[$thisKey][1].','.$data1[$thisKey][2].','.$data1[$thisKey][3].','.$data1[$thisKey][4].','.$data1[$thisKey][5].','.$data2[$thisKey][0].','.$data2[$thisKey][1].','.$data2[$thisKey][2].','.$data2[$thisKey][3].','.$data2[$thisKey][4].','.$data2[$thisKey][5]."<br>";
        }
    }
    // "id","members name","access code","expiration","pin","704241" "address","city","state","","zip","704241"



    // functions...
    function filetoarray($file,$idKeyCol){
        
    $rawData1 file_get_contents($file);
        return 
    cleanlines($rawData1,$idKeyCol);
    }

    function 
    cleanlines($data,$idKeyCol){
        
    // expand it at the linebreaks
        
    $newData explode("\n",$data);
        
    $cleanData = array();
        
    $j count($newData);
        for(
    $i 0$i $j$i++){
            
    $thisParts explode(",",$newData[$i]);
            
    $cleanData[$thisParts[$idKeyCol-1]] = $thisParts;
        }
        return 
    $cleanData;
    }
    ?>
    Last edited by jmj001; 05-20-2012 at 01:24 PM.

  • #7
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey,

    Thanks Jim, so im guessing i upload this to an ftp with my 2 files and run the script, after chmod'ing them correctly? thanks.

  • #8
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You sir are a genious, send me a PM and i will get you paid.

  • #9
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    PM sent... I'm guessing it worked as required then?

    Cheers...

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Good luck trying to get paid. They can only use their bank, paysafe, skype minutes, or western union (eventually).
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    I guess we'll find out if he's an honest man...

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Let us know how it works out.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #13
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    as expected.. no word from the OP for more than 24 hours now.. we'll see but it's looking like a non payment at this stage...

  • #14
    New Coder
    Join Date
    Nov 2010
    Location
    California
    Posts
    42
    Thanks
    6
    Thanked 2 Times in 2 Posts
    So did the OP pay you yet?

    PayPal is always an option...
    Puppet Master + Programming = Eternal Bliss

  • #15
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    Nope, had no word from him for a couple of days now... he won't pay now, the little weasel got his code.
    hey... it's a sig..


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •