Innaz Review, Samsung Galaxy, price and specifications, Flash Android, Games For Your Apple, Jailbreak Tool For iOS, IMEI Unlock Method

Jumat, 18 Maret 2016

How to use a text file as a database while programming

How to use a text file as a database while programming - In the past, when I started to start blogging, many thoughts disturbed me. I want to have a blog with a nice and interesting look. I am constantly looking for basic tutorials from some web and blogs on the internet. And thankfully, one by one I started to do it, and of course have to go through some confusion process first, but the most important of a blog that is content, yes on the blog Innaz Review we will discuss a lot of information about gadgets that are very in need by you, now we will discuss first about How to use a text file as a database while programming please refer to the information we will convey until completion:

Articles : How to use a text file as a database while programming
full Link : How to use a text file as a database while programming

You can also see our article on:


How to use a text file as a database while programming

Welcome back to another post of Teckguide. It has been really long since I have written a post, I am really sorry about that. But I am back with a useful and informative post for all of you. In this post we will see how to use a simple text file as a database.

Not a lot of people realize this but normal text file can be a simple alternative for a database like SQL, mongo etc. Although a database is simple to use, beginners find it difficult to use them in their program. So this post if for you if you belong to that category. But before that,

What is a database?

A database is a collection of data that is stored in the form of tables or relations to easily access any element and all its aspects in one place. These databases have a special column for a ‘primary key’ where a value, that uniquely differentiates all the element, is stored.

So it can be imagined like a table with multiple rows and columns. A database can multiple tables. For example, a company can have a database where they can have one table for details of the employee salary details, one table for employee designation etc. But all these tables will have on common column so that it is easy to connect the tables with each other. Also a database may or may not require a password to access the data.

How is it used?

Generally, a database is created using a language like SQL. and the database is hosted on the internet. Once a database is hosted on the internet, is can be remotely from anywhere. There are two basic kinds of access provided for the database. A) Read access B) Read and WRITE access. If only the read access is provided, the user can only read the data but cannot write anything to it. But with the read and write access the user can read as well as write data to the database.
Once the access to the database is gained, the data can be retrieved from the database programmatically. Most of the programming languages provide modules to work with databases.

The alternative:

The data can be represented on a text file also in the form of tables. Well not exactly tables, but close enough. Using a text file instead of a database is not exactly a wise thing to do but for the time being it is good enough.
So let’s just get into get into how it’s done.
  • In a regular text file, the columns can be represented by separating the values by either a coma or space.
  • The rows can be separated by sentences, i.e. one sentence represents on row.
  • These files can be read easily using any programming language.
  • While reading the data, each sentence can be stored as different elements of an array.
  • Further, each value can be stored in another sub array. So the whole data is stored in a 2D array.
  • Now every element can be accessed easily for example by using split() function in python. Specially in a language like python where there is dictionary datatype.


This way we can not only read but also add more entries and modify existing ones. According to me this is a very simple and easy alternate for a database.

This can be used in small scale projects, school projects, test purpose etc.

That is all I have for today, I will be back with more interesting and useful programming tips in the future. Until next time, don’t forget to subscribe, share and like.




so much information How to use a text file as a database while programming

hopefully How to use a text file as a database while programming information can provide benefits for you in determining the gadgets that fit your needs in daily life.

you just read How to use a text file as a database while programming if you feel this information is useful and want to bookmark or share it please use link https://innaz2.blogspot.com/2016/03/how-to-use-text-file-as-database-while.html if you want more information please search on other pages this blog.

Tag :
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : How to use a text file as a database while programming

0 komentar:

Posting Komentar