Programming Basics
  Home arrow Programming Basics arrow Working with text files
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PROGRAMMING BASICS

Working with text files
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    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

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    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


       · Well laid steps in this tutorial. Thank you.
       · You have done a great job here.Thanks
       · no crap... good tutorial
       · This is the text.
       · Thanks, a very helpful tutorial
       · Really, I built a whole portal engine in 4 days with this tutorial. You can check it...
     

    PROGRAMMING BASICS ARTICLES

    - Loops and PHP Decision Making
    - Operators, Conditionals, and PHP Decision-Ma...
    - PHP Decision-Making
    - Coding
    - Server Statistics
    - Looping in PHP
    - Cookies in PHP
    - Working with text files
    - Beginning Object Oriented Programming in PHP
    - A Tour of Decision Making Structures in PHP
    - PHP Strings Primer
    - PHP Control Structures
    - Intro to Vim
    - Reading Directorys with PHP
    - An Overview of Arrays in PHP






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway