By fixed length, I assume you mean fixed field lengths.  Use CF's LJustify()
and/or RJustify() functions to easily set a string within a fixed width,
space-padded string.  You might have something like the following:

<cfquery name="myquery" datasource="#mydsn#">
SELECT *
FROM sometable
</cfquery>

<cfset crlf = Chr(13) & Chr(10)>

<cfset s = "">

<cfloop query="myquery">
  <cfset s = s & LJustify(myquery.firstname, 15)>
  <cfset s = s & LJustify(myquery.lastname, 15)>
  <cfset s = s & LJustify(myquery.address, 25)>
  etc....
  <cfset s = s & crlf>
</cfloop>

<cffile action="write" file="c:\somefile" output="#s#">

Jim


----- Original Message -----
From: "FatDot - Lenny Sorey" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, December 15, 2000 4:03 PM
Subject: Fixed length export from Access 97


> Has anyone ever created a fixed length text export file using Access 97
with
> CF 4.5.1 SP2?  I have no problem creating a text file with delimiters,but
as
> of yet I cannot seem to find the answer to create a fixed length text
file.
>
> Any help or suggestions would be appreciated.
>
> Regards,
>
>
> Lenny R. Sorey
> FatDot.Com
> [EMAIL PROTECTED]
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to