Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6710351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:00:41+00:00 2026-05-26T08:00:41+00:00

For each line of a CSV file, my application needs to call a method

  • 0

For each line of a CSV file, my application needs to call a method which reads in each variables and writes some of them to a table using a GetDataItem method. e.g.

Var
Item: String;
Tmp: String;
Rdate: String;
TmpDateTime: TDateTime;

begin
Table1.Append'
Tmp := GetDataItem(Data, Item); {Ignore}
Tmp := GetDataItem(Data, Item); {Ignore}
Tmp := GetDataItem(Data, Item); {Members ID}
Table1.FieldByName('Member ID').AsString := UpperCase(Tmp);
TmpDateTime := StrToDateTime(etDataItem(Data, Item));
Table1.FieldByName('Arrival Date').AsString := FormatDateTime('dd/mm/yyyy',TmpDateTime);
Table1.FieldByName('Arrival Time').AsString := FormatDateTime('hh:mm:ss',TmpDateTime);
...
Table1.Post;

This works fine except I also need to generate a ReverseDate from the DateTime stamp in the format yyyymmdd. However any attempt to use the timestamp variable again seems to throw an exception e.g.

RDate := FormatDateTime('yyyy',TmpDateTime) + FormatDateTime('mm',TmpDateTime) + FormatDateTime('dd',TmpDateTime);

or

RDate := FormatDateTime('yyyymmdd',TmpDateTime);

I’ve tried duplicating the DateTime variable and working on that instead, or splitting a DateTime String, but it’s as if any further manipulation of throws an exception when run.

EDIT: Apologies, On my XP machine I now get the exception:

EAccessViolation in the module 'ImpWintacs.exe' at 000749DA. Access violation at address "000749DA" in module 'ImpWintacs.exe'. Read of address 00C1FDF8.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:00:42+00:00Added an answer on May 26, 2026 at 8:00 am

    The method I was using to read the next variable from the CSV, read the chars up until the next comma. The last variable in the CSV was not followed by a comma. As I didn’t need the last variable anyway I just chose not to read it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VB web application that reads from a CSV file which contains
I have a .csv file containing over 70 million lines of which each line
I'm trying to output each line in a csv file, and it seems like
I want to read each line from a text file and store them in
I have a loop that reads each line in a file using getline() :
I have this code to read a CVS file. It reads each line, devides
I am reading in a csv file and dealing with each line as a
I have a CSV file with 6 millions rows. Each line is made up
I have a CSV file. Each line is made up of the same format
I have a CSV file and using fgetcsv I can happily generate each line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.