+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    03-06-2010
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    exporting for database..

    Hi, I can't seem to find out to fix this issue...I have my spread sheet set up with all columns needed, my only issue is, when I save it as a text file, it adds quotations " " and also adds to much space between each column, so when I dump it on the DB, I get errors...As I read around on the net, I found that I can open the text file in word and find and replace all quotations and it's done quickly, but I still have the issue with the spacing..I used an add-in for triming the columns to remove spacing, but doesn't seem to work..Here is an example of what it looks like: See, too much space is added....Can anyone please guide me in the correct direction on how to fix this?...Thanks.

    INSERT INTO `PLD_LINK` (`url`, `title`, `description`, `status`, `LINK_TYPE`, `RECPR_REQUIRED`, `category_id`) VALUES (http://www.testeter.com/ , Test , Retained search test , 2 , 0 , 0 , 1339 );

  2. #2
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    re: exporting for database..

    Can you not go into the Db and inthe table catagory right click and choose Import Table, this will allow you to directly import it in.

    The other way I guess is when you save the spredsheet, instead of a text file, why not a CSV file?

  3. #3
    Registered User
    Join Date
    03-06-2010
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: exporting for database..

    Hi, I tried previously to import it directly in the DB but I get errors....

    "Invalid field count in CSV input on line 1."

    I don't know if it has to do with the CSV options in the DB..They are set to the below:

    Replace table data with file "Not checked off"
    Ignore duplicate rows "Not checked off"
    Fields terminated by ;
    Fields enclosed by "
    Fields escaped by \
    Lines terminated by auto
    Column names "Left Blank"

    My spread sheets has all the " ; \ already in separate columns..


    Thanks..
    Last edited by mike77; 03-06-2010 at 06:16 PM.

  4. #4
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    re: exporting for database..

    I guess in this instance without seeing the Db and files in question it will be very hard to tell.

  5. #5
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: exporting for database..

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    I have edited it for you
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  6. #6
    Registered User
    Join Date
    03-06-2010
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: exporting for database..

    Quote Originally Posted by jj72uk View Post
    I guess in this instance without seeing the Db and files in question it will be very hard to tell.

    Hi, Thanks, I have attached the sample file. You will notice that when saved as a text file it has extra spaces and also the quotations, but I can remove the quotations in Word, but not he spacing...

    Thanks much..
    Attached Files Attached Files
    Last edited by mike77; 03-09-2010 at 02:54 AM.

  7. #7
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: exporting for database..

    OK, so thats a txt file, what about a CSV file?

    If the data isnt to sensitive can you up load both Db and XL sheet?

    Additianlly I'd suggest reading royUk's comments.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0