ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 27th, 2003, 11:52 AM
MSFletch MSFletch is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Utah
Posts: 6 MSFletch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to MSFletch
Question Tab Delimited Text File

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

Reply With Quote
  #2  
Old November 5th, 2003, 04:43 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,681 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 22 m 41 sec
Reputation Power: 53
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.

Reply With Quote
  #3  
Old September 27th, 2005, 03:17 PM
Lugnut Lugnut is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 1 Lugnut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 37 sec
Reputation Power: 0
<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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Tab Delimited Text File


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT