+ Reply to Thread
Results 1 to 4 of 4

CSV file not showing the db results properly

  1. #1
    Registered User
    Join Date
    12-13-2007
    Posts
    18

    CSV file not showing the db results properly

    Hi

    I am using a php script to download the database to CSV file, as this is a Excel Forum I thought I would ask to see if any of you might know the root of my problem.

    All of the database shows correctly with exception of the phone numbers, the first 2 numbers show correctly then the 3rd has the zero missing from the beginning the next number is fine then the next 4 all have the zero missing.

    Oddly enough the numbers that are incorrect are aligned right and the correct ones are aligned left, any ideas anyone?

    Thanks,

    Phil
    Last edited by VBA Noob; 09-24-2008 at 03:49 PM.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Most likely it is a problem with your script. Phone numbers would be a string, not number per se. To be sure that you are creating the csv file properly, open it in Notepad or WordPad. You can create a dummy csv file in Excel and open it in one of those programs to see how it formats the data.

    If your database is entering phone numbers as just numbers with no dashes or periods separating parts as is normal, then it is probably using a number format to prefix 0's as excel can do. In that case, your code has to format that number as a string with leading 0's for the csv file.

    If the csv data is proper, then your import method may need tweaking. You will need to explain your method in that case. A sample csv attachment helps us troubleshoot this kind of issue.

  3. #3
    Registered User
    Join Date
    12-13-2007
    Posts
    18
    Hi

    I have just been told on another forum that if there is a string of digits, excel strips off the 0 at the begining. So it looks like a php coding problem.

    Thanks anyway,

    Phil

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Then it is as I suspected. You can choose to fix it in your php code as you said or Excel can fix it in a number of ways. CSV files are pretty basic, numbers and strings.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 08-25-2008, 04:44 AM
  2. Excle data file and macro publishing problem
    By sujata_ghosh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2008, 04:19 AM
  3. Check if file may be saved with this button
    By Analbers in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2008, 12:45 PM
  4. Rename Excel File via FTP using macro
    By buczacz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2007, 04:20 PM
  5. Replies: 1
    Last Post: 08-08-2007, 03:50 AM

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.6.0 RC 1