Professional Web Applications Themes

cfhttp error "Invalid column header" - Coldfusion - Advanced Techniques

I got a very simple csv file name "test.csv" which has from,to,email test,test,"test,test" My code <cfhttp name="get_file" url="test.csv" method="get" delimiter="," textqualifier=""""></cfhttp> I kept getting invalid column header error and if I enter textqualifier as = "", then I run into a diff. error "Incorrect number of columns in row", this only occur if I have a comma in one of my colum but it will work fine if my email column only have one value. This is why I was hoping to use textqaulifier to solve the problem but I can't seem to get it working. Any one have any ...

  1. #1

    Default cfhttp error "Invalid column header"

    I got a very simple csv file name "test.csv" which has
    from,to,email
    test,test,"test,test"

    My code
    <cfhttp name="get_file" url="test.csv" method="get" delimiter=","
    textqualifier=""""></cfhttp>

    I kept getting invalid column header error and if I enter textqualifier as =
    "", then I run into a diff. error
    "Incorrect number of columns in row", this only occur if I have a comma in one
    of my colum but it will work fine if my email column only have one value. This
    is why I was hoping to use textqaulifier to solve the problem but I can't seem
    to get it working. Any one have any suggestions or ideas of how I can read
    this type of format using cfhttp? Thanks.





    SangLe Guest

  2. #2

    Default Re: cfhttp error "Invalid column header"

    You should use cffile to read files off your own server. Then just treat the file as a string and use the relevant functions and loops to get what you want from the file!
    Stressed_Simon Guest

  3. #3

    Default Re: cfhttp error "Invalid column header"

    OK, I use your suggestion and it almost there, I was able to separate the list
    with return characters but now the problem is the row data, e.g.
    test,test,"test,test2",test

    What function do I use to tell CF that there are only 4 items on this list, it
    will be 5 if I use comma as delimeter, any suggestions?


    SangLe Guest

Similar Threads

  1. the error "invalid plugin detected. Adobe Reader will quit"
    By bruce628@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 17
    Last Post: April 9th, 09:42 AM
  2. Replies: 3
    Last Post: December 27th, 07:26 PM
  3. Acro Pro Update Error: "An invalid application was selected."
    By FordRack@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 8
    Last Post: September 18th, 12:20 AM
  4. "Invalid color" error every time Acrobat 7 is launched under Tiger
    By Marc_Bizer@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 10
    Last Post: May 22nd, 02:46 PM
  5. "Invalid message format" error from JDBC driver
    By leon-pg@comvision.com in forum PostgreSQL / PGSQL
    Replies: 1
    Last Post: January 23rd, 02:47 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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139