Need a Quick PHP Script: $15

Discussion in 'Programming' started by mikem79, Sep 17, 2007.

  1. #1
    I am still a PHP newbie and I have wasted an hour so far on what would take an experienced coder 5 to 10 minutes to accomplish.

    I need to create a series of text files from records in a csv

    Psuedo Code:

    1) Assume the presence of a CSV file named "mike.csv" in the same directory as the script

    2) mike.csv has two fields per record:

    - a text file name (with the extension ".static"), a url

    for example:

    xyz.static,http://www.wherever.com

    3) open mike.csv

    4) for each record write out a new text file in this format:

    <script type="text/javascript">
    <!--
    window.location = "URL from CSV GOES HERE (Field two)"
    //-->
    </script>

    The new text file then gets saved as "xyz.real". In other words, simply change the extension from field 1 from ".static" to ".real".

    So, here is a real example:


    INPUT

    mike.csv
    abc.static,http://www.siteone.com
    def.static,http://www.sitetwo.com

    OUTPUT

    abc.real

    <script type="text/javascript">
    <!--
    window.location = "http://www.siteone.com"
    //-->
    </script>

    and

    def.real

    <script type="text/javascript">
    <!--
    window.location = "http://www.sitetwo.com"
    //-->
    </script>

    That is it. If it matters, there may be as many as 50,000 records in mike.csv, but typically there will be 200 to 1,000.

    If you can this quickly (like within an hour of reading this post) then simply claim the job right in this thread then PM me the script. I will load it up to my server, test it and pay you the $15 once I see that it works.

    Please do not PM a script unless you were first to claim it. I don't want any misunderstandings of hard feelings. I only need one workable script. If the first does not deliver I will ask the second person claiming it to do it.

    Thanks.
     
    mikem79, Sep 17, 2007 IP
  2. omgitsfletch

    omgitsfletch Well-Known Member

    Messages:
    1,222
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    145
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    I'll claim it.

    PM'ing you the script for review now.
     
    omgitsfletch, Sep 17, 2007 IP
    guerilla likes this.
  3. phptechie

    phptechie Well-Known Member

    Messages:
    885
    Likes Received:
    10
    Best Answers:
    2
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Hi,

    Is this job still open?

    If so I can get you the script ready.
     
    phptechie, Sep 18, 2007 IP
  4. mikem79

    mikem79 Peon

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    The job was done quickly and well by omgitsfletch.

    However, I have a need for some php assistance from time to time, so if you get a moment please PM your skill set, rates, etc.

    Thanks.
     
    mikem79, Sep 18, 2007 IP
  5. phptechie

    phptechie Well-Known Member

    Messages:
    885
    Likes Received:
    10
    Best Answers:
    2
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    Ok ,I had sent you an PM.
    Check it up & let me know if you have further questions.
     
    phptechie, Sep 18, 2007 IP