I am working with ascii delimited data, trying to read them into a SQL
Server table through a web browser interface. After it is all working I want
to convert it to a scheduled event.

The ascii is currently delimited by the pipe (|) with no enclosing quotes on
the fields. CRLF defines the start of a new record. It is output by a third
party program. I can change the delimiter and quotes inside the program
prior to output.
Ex.
197330|AY|20001211|25|88|20001211|Fall|2001|Li|Benhig||||19710706|Beijing,Ch
ina|Male|[EMAIL PROTECTED]|61|||214||DongYingFang
907-5-9|DongGaoDi|Beijing||61|100076|20101231||DongYingFang
907-5-9|DongGaoDi|Beijing||61|100076|DongYingFang
907-5-9,DongGaoDi|Beijing||61|100076|20011231|||235|numerical
analysis|Ph.D.|1||Full Time|||ErPao Institute of
Technology|09/88|07/92|BS|07/92|3.5|ErPao Institute of
Technology|09/93|03/96|MS|03/96|3.4|||||||||||||||||||||||||Automatic
Control Engineering|3.5|4.0|Aerocraft Control,Guide and Simulatio;MS||Other
(specify
below)|English|12/99|480|54|800|99|730|91||||08/00|643|||Liao|Professor.Grad
uate Adviser|ErPao Institute of Technology|Zhang|Professor,Graduate
Adviser|Capital Normal University|Ke|Professor,PhD|National Natural
Sci||||Chinese Academe of Launch Vehicle
Tech.|Beijing|04/96|08/00|Engineer|||||||||||||

I can read it into a textarea field with no problem using CFFILE. I can even
do a simple ListLen to get the number of records in the file. Works fine so
far.

<cfoutput>
<cfset cr = chr(13) & chr(10)>
<p>The import list contains #ListLen(AIMxport, "#cr#")# records.</p>
<cfset reccountno = #ListLen(AIMxport, "#cr#")#>
</cfoutput>

Next I submit this to the processing page.
Ex.
<!-- Testing page -->
<cfset id = 1>

<cfset cr = chr(13) & chr(10)>

<!---

This is where I am trying to make all fields appear, not working though
 <cfset AIMList = "#ListQualify(AIMLIST, """","|","ALL")#">

--->

<cfloop index="LoopCount" from="1" to="#reccount#">
<cfoutput>
<h4>Main List Element #id# - Test ListGetAt function to get individual lines
in the big list.</h4>

<cfset fulllist = "#ListGetAt(AIMList, "#id#", "#cr#")#" >
<p>List length #id#: #ListLen(fulllist, "|")#</p>
<p><b>#id#</b> - #fulllist#</p><p>&nbsp;</p>
<!--- <p><b>#id#</b> - #ListGetAt(AIMList, "#id#",
"#CR#")#</p><p>&nbsp;</p> --->

<h4>Main List Element #id# - Test Getting Individual Field Elements in the
list</h4>
</cfoutput>

        <cfset listcount = #ListLen(fulllist, "|")#>

        <cfset fieldid = 1>

                <cfloop index="LoopCount1" from="1" to="#listcount#">

                        <cfoutput><b>#fieldid#</b> - #ListGetAt(fulllist, "#fieldID#",
"|")#</cfoutput><br>

                <cfset fieldid = fieldid + 1 >

                <!--- The insert would happen here abouts. We need to insert each field
into the tblApplicantPreload by looping through the list. --->

                </cfloop>
        <cfset id = id + 1 >
</cfloop>


So far I can run the above and it all prints fine. Each full record appears
in the top and then a list of fields appears below it.

PROBLEM
Missing fields. I cannot figure out how to make the list function show
fields that contain no data. It just seems to drop them, they do not appear
in the output. I have tried ListQualify and that does not seem to help. Am I
missing something here? Do lists not include the blank fields. The first
record runs and shows 92 total fields (ListLen) the next record runs and
shows only 67 fields. The second record has less data filled in by the user.
I can see all of the fields in the input side. Frustrating the heck out me.
Any better way to do this?

Regards,

Gary McNeel, Jr.
DACNet Project Manager
Research and Graduate Studies
Rice University
[OP] 713-348-6266
[M] 713-962-0885
[HO] 713-723-9240


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to