• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cffile: reading over file

Contributor ,
Jul 17, 2007 Jul 17, 2007

Copy link to clipboard

Copied

Hi all,

I am trying to figure out the best way to read over a file and stuff the contents into a database.

The file contains three line blocks of customer data.

I need to create a loop and create a condition where it reads the first three lines, then stuffs the parsed line items info into the database table, then the second group of three lines...etc.

How would I approach this.

I already have the cffile read part figured out now how would I loop over the 3 line condition and stuff database with parsed info?

I am also using Coldfusion 8 so I can do a cfloop over the cffile read variable as a query, because I believe the cffile variable can be treated this way...but I could be misinformed or approaching the problem wrong.
TOPICS
Advanced techniques

Views

205

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 17, 2007 Jul 17, 2007

Copy link to clipboard

Copied

LATEST
What is the character that terminates each line? If we assume ASCII 10, then you could read the entire file in and treat it as a list delimited by Chr(10). See concept code below.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation