|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi again folks. I am having a probloem reading a tab-delimited text file with Cold Fusion. My text file is formatted like this:
order [tab] subdef [tab] question [break] 1 [tab] 1 [tab ] This is the question text, and this, and this. [br] ... where [tab] and [break] represent a tab and hard return. I upload the file to the server and then access it using the following code: <CFHTTP METHOD="Get" URL="http://64.78.9.48/manage/test/objectives_list.txt" NAME="objectivesList" DELIMITER="Chr(9)" TEXTQUALIFIER=""""> I get an error every time that says: "order subdef question" IS NOT A VALID COLUMN HEADING. I assume that this error comes from the code not recognizing my delimiter as an appropriate value, since Cold fusion highlights that row when displaying the error. So the real question is whether or not someone has an idea of how to code that tag correctly, or if someone has another idea of how to create a query that I can access like a normal database query from a tab deliited text file. MANY THANKS IN ADVANCE!! Matt Fletcher ![]() |
|
#2
|
|||
|
|||
|
Before you write the file you could replace spaces in your column headers with underscores or something, and then when you read it back in, just replace the underscores back to spaces. The problem is that you are trying to tell CF to build a query object out of the data it gets in your HTTP call, but CF (and most other languages) don't allow spaces in variable names (which the column headers are).
hope that helps. |
|
#3
|
|||
|
|||
|
<CFHTTP METHOD="Get"
URL="http://64.78.9.48/manage/test/objectives_list.txt" NAME="objectivesList" DELIMITER="Chr(9)" TEXTQUALIFIER=""""> Should be <CFHTTP METHOD="Get" URL="http://64.78.9.48/manage/test/objectives_list.txt" NAME="objectivesList" DELIMITER="#Chr(9)#" TEXTQUALIFIER=""""> Other wise it is looking for the text Chr(9) as a deliminator |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Tab Delimited Text File |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|