Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying a text file with no column names

Status
Not open for further replies.

dinoviapangea

Technical User
Apr 9, 2002
41
US
How can I query a text file with no column names, for example:

Fred|Flintstone|Bedrock|
Betty|Rubble|Bedrock|
Barney|Rubble|Bedrock|
Spongebob|Squarpants|Bikini Bottom|

I can do the query with column headers, for example:

fname|lname|location|
Fred|Flintstone|Bedrock|
Betty|Rubble|Bedrock|
Barney|Rubble|Bedrock|
Spongebob|Squarpants|Bikini Bottom|

Any Ideas?

Thanks.
 
You could use CFHTTP to do it and get it to return the data as a query, then you just loop over the query like normal.

Like this:

<cfhttp url=&quot; method=&quot;get&quot;
delimiter=&quot;|&quot;
textqualifier=&quot;&quot;&quot;&quot;
Name=&quot;getData&quot;
columns=&quot;a,b,c&quot;
timeout=&quot;10&quot;
firstrowasheaders=&quot;no&quot;>

<table border=0 cellpadding=5 cellspacing=0>
<TR>
<TD>Column A</TD>
<TD>Column B</TD>
<TD>Column C</TD>
</TR>
<cfoutput query=&quot;getData&quot;>
<TR>
<TD>#getData.a#</TD>
<TD>#getData.b#</TD>
<TD>#getData.c#</TD>
</TR>
</cfoutput>
</table>

Hope this helps!

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top