Joining .sql files

Discussion in 'Programming' started by TheBiaatch, Aug 15, 2006.

  1. #1
    Hi, I got a automated backup of my database of my site...

    It is all in a .zip file and when I open it I get the files on the screenshot below...

    [​IMG]

    My question now is: How do I join all these sql files into 1 sql file or 1 gzip file?


    Thanks for the help :)

    Peace
     
    TheBiaatch, Aug 15, 2006 IP
  2. tbarr60

    tbarr60 Notable Member

    Messages:
    3,455
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    210
    #2
    I expect the application you exported from would import from the zip file. If you need it to be one file for some other purpose you can cut and paste the content of each file into a single file manually or write some code to do it.
     
    tbarr60, Aug 15, 2006 IP
  3. talentcoder

    talentcoder Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    1. unzip files
    2. type *.sql > all_in_one.sql
     
    talentcoder, Aug 16, 2006 IP
  4. tbarr60

    tbarr60 Notable Member

    Messages:
    3,455
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    210
    #4
    I assume you run that from a command prompt but I get a blank file or an error when I try variations of your step 2.
     
    tbarr60, Aug 17, 2006 IP
  5. Brilliances

    Brilliances Active Member

    Messages:
    619
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    60
    #5
    I haven't done *nix file handling for ages, but how bout

    cat *.sql > all_in_one.sql
    Code (markup):
     
    Brilliances, Aug 22, 2006 IP
  6. TheBiaatch

    TheBiaatch Peon

    Messages:
    435
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    OK thanks, worked :)
     
    TheBiaatch, Sep 16, 2006 IP