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 673709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:37:33+00:00 2026-05-14T00:37:33+00:00

We get a new copy of data in a pipe-delimited text file from time

  • 0

We get a new copy of data in a pipe-delimited text file from time to time. I have to refresh the table or in other words, replace the existing copy with that of the newly generated copy (output.txt).

Any ideas are highly appreciated. Thank you..

TRUNCATE Table elements;

LOAD DATA INFILE '/data/out.txt' IGNORE INTO TABLE elements FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n' (ID, Title, date, time);
  • 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-14T00:37:34+00:00Added an answer on May 14, 2026 at 12:37 am

    I agree more information is needed to answer your question. As I understand it you need to empty a database table and reload it with the information in the text file you received, which sounds like a CSV file that uses pipes instead of commas. Do I have this right?

    So you need to…

    Step 1 – Get your information out of the text file.
    You can try something like fgetcsv() (setting the delimiter to ‘|’), or you could just use fgets() and use explode() to put the data in an array.

    Step 2 – Insert data into your database table
    Loop through you data until you have it all in there. If all goes well then…

    Step 3 – Delete the old data
    It might seem easier to empty the database first, and then add your data. You could do that, but if something goes wrong with the new data then what? Now you’re stuck with an empty database table until you fix it. Depending on what this is used for that could be undesirable.

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

Sidebar

Related Questions

I'm using the migrate module to copy data from several sources to a new
I have two lists and I want to copy data from one to another
I have a largish table of data pulled from my database (~1500 rows, each
I am new to copy constructors and can't seem to get them working when
I am using msgget() syscall to get new msg queue. I have used the
I have a search page which uses a simple ajax request to get new
How to get a new sequence from an old sequence, the elements of the
I'm using SQLBULKCOPY to copy some data-tables into a database table, however, because the
Possible Duplicate: File to byte[] in Java I want to read data from file
In django, I want to copy data from identical tables in one db to

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.