Programming Basics

  Home arrow Programming Basics arrow Working with text files
PROGRAMMING BASICS

Working with text files
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2004-01-06

    Table of Contents:
  • Working with text files
  • Opening a text file
  • Writing data into a text file
  • Closing a text file
  • Reading from a text file
  • Deleting a file
  • Other functions regarding text files
  • An example
  • Advanced examples
  • Conclusion

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Working with text files


    (Page 1 of 10 )

    Learn how to perform different tasks with text files in this tutorial from Subhash Madhawa.

    By : Subhash Madhawa

    Welcome to my tutorial on "Working with text files"!

    When you have an idea to design a website that has the ability to handle data inside it, normally you start off the project planning the database type, database structure, etc. Normally, the database type depends on the amount of records you'll handle and how often you will be accessing those records.

    Depending on the amount of records, there are basically two ways of storing data: in a structured database or in a simple text file.

    If you are dealing with information of a reasonable amount of volume, such as, information of registered members in your site, you'll need a database. But, there will be situations where you need to know how to work with text files and get use of them. I will provide some useful examples as we work through this tutorial.

    Is working with a text file easier than working with a database?

    Working with text files is a very simple thing to do in PHP scripts. Database programming is also not a hard job. However, text files are a good starting place for novice programmers. In this tutorial I hope to teach you, how to:1. Open a text file.2. Write data into a text file.3. Close a text file.4. Read from a text file.5. Delete text files.7. Other functions regarding text files.8. An example & summarizing tutorial.9. Advanced examples:* Update selected rows in a text file* Deleting rows in a text file* Searching rows in a text file

    Now let's go through the tutorial, step by step!

    More Programming Basics Articles
    More By Codewalkers

    blog comments powered by Disqus

    PROGRAMMING BASICS ARTICLES

    - Control Flow Constructs
    - More Time Manipulation with PHP
    - Validating and Manipulating Dates with PHP
    - Using the Date Constructor in PHP
    - Calendar Construction with PHP
    - PHP`s Calendar Package
    - Getting Modified Versions and Correct Dates ...
    - Combining Date Functions in PHP
    - Using PHP for Date and Time in Programming
    - More Exception Handling with PHP
    - Exception Handling in PHP
    - Error Logging and Handling Exceptions
    - Configuration Directives for Error and Excep...
    - Error and Exception Handling
    - Python Modules for Games


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap