SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with import data from CSV file

    I have a CSV file with a column containing both Numeric and Text data. Using ASP code when I import the data from that column I only get Numeric data not Text.

    Below is the example of data


    CODE:

    499
    549
    234

    A23
    T33
    YY2

    I tried to convert CSV column to text but it did not work.

    Please advice.


    Thank you,
    Zeeshan

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sample of actual CSV file data?

    Your current ASP code?

    Your post doesn't offer enough info to be able to help.
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying to my post. I have attached inventory file in zipped format and below is the connection code:

    set db = server.createobject("adodb.connection")
    connstr = "Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=c:\www\inventory\;"
    db.ConnectionString = connstr
    db.Open

    sQuery = "SELECT * FROM inventory.csv"
    Attached Files Attached Files

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sorry but I still don't see where the problem is. Yes - that's your query. But you're not showing what you are then doing with sQuery.

    BTW - when I tried to open your CSV file in Excel 2003 it gave a prompt that the file "is a SYLK file but cannot load it. Either the file has errors or it is not a SYLK format". I can then proceed to open the file and see tabular data, but this error may or may not be significant in regards to your code working.

    PS - I've no idea what SYLK means.
    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    SYLK = Symoblic Link

    I still don't know the relevance of SYLK to CSV files though.
    Ian Anderson
    www.siteguru.co.uk


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
  •