?
Solved

Create tab delimited file using cfsavecontent

Posted on 2007-10-15
6
Medium Priority
?
2,429 Views
Last Modified: 2013-12-24
I want to create a tab delimited TXT file using this code, however, I cannot figure out how to force a line break in the TXT file after each row our output in the cfsavecontent.

<cfsavecontent variable="textfile">
<cfoutput>eventname#chr(9)#location#chr(9)#startdate#chr(9)#enddate
</cfoutput>
<cfoutput query="getdata">#getdata.eventname##chr(9)##getdata.location##chr(9)##getdata.startdate##chr(9)##getdata.enddate#</cfoutput>
</cfsavecontent>
<cffile ACTION="Write" FILE="#APPLOC#" OUTPUT="#textfile#" ADDNEWLINE="no">


0
Comment
Question by:bjv211
  • 3
  • 2
6 Comments
 
LVL 14

Accepted Solution

by:
Scott Bennett earned 2000 total points
ID: 20081401
just add #chr(13)##chr(10)# to the loop like:

<cfsavecontent variable="textfile">
<cfoutput>eventname#chr(9)#location#chr(9)#startdate#chr(9)#enddate</cfoutput>
<cfoutput query="getdata">#chr(13)##chr(10)##getdata.eventname##chr(9)##getdata.location##chr(9)##getdata.startdate##chr(9)##getdata.enddate#</cfoutput>
</cfsavecontent>
0
 
LVL 1

Author Comment

by:bjv211
ID: 20236213
ooop s sorry
0
 

Expert Comment

by:futr_vision
ID: 24694894
What goes in FILE="#APPLOC#"
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:bjv211
ID: 24695034
The path and extension where you'll save the file:

For example:  FILE="D:\WebRoot\OuputFiles\Test.csv"
0
 

Expert Comment

by:futr_vision
ID: 24695185
Ok. I think I figured it out. After writing this file is there a way to delete the file from where it is stored?
0
 

Expert Comment

by:futr_vision
ID: 24695201
Also, what if I don't know or want to use drive letters? Is there a way to just dump it in the root directory or a designated directory without the drive letter?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question