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.
Results 1 to 4 of 4

Thread: parsing csv

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    parsing csv

    I have a friend who has asked me to take some excel files which he has made csv files and create a web page to where he can simply upload the file and have it parsed into a database.

    I have not done this before and was wondering if anyone could point me in a good direction on how I could go about doing this.

    Thanks,

  • #2
    New Coder
    Join Date
    May 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Most often csv files are just formatted text files, ask for an example of the csv file and then you can decide the best method to parse it.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I hae tried a few ways I have even used the fgetscsv() function for php, it will parse it just fine to another flat file, however it seems to fill my db with nothing but null values when I try to write to the database, I am thinking that since some of the fields are blank that mysql has a problem with that.

  • #4
    New Coder
    Join Date
    May 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it should not bother mysql that some of the fields are blank. what I would do is instead of executing your query just echo it. Then you can see exactly what the query looks like. If your query looks fine look for an error in the syntax with mysql_error()


  •  

    Posting Permissions

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