# Editing Flat-file database one line at a time

**URL:** <https://forum.kirupa.com/t/editing-flat-file-database-one-line-at-a-time/205659>\
**Category:** Uncategorized\
**Created:** [October 31, 2006, 7:22pm UTC](https://forum.kirupa.com/t/editing-flat-file-database-one-line-at-a-time/205659 "2006-10-31T19:22:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![buildakicker](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@buildakicker](https://forum.kirupa.com/u/buildakicker)\
**Post date:** [October 31, 2006, 7:22pm UTC](https://forum.kirupa.com/t/editing-flat-file-database-one-line-at-a-time/205659/1 "2006-10-31T19:22:54Z")

</div>

I am trying to edit just one line of entry in my flat-file database. I don’t have access to MySql or another database, so flat-files is what I have to work with. I would like to make an editor for a user selected row in my flat file, then submit the form and update just that row. I am not exactally sure how this will work and am looking for some input from you all.

Here is what I am thinking so far:

```auto

open file
feed file rows into array
loop until end of file{
put array info in variables (var0 = array[0] var1=[1] [2] etc...)
}

user selects array[0](array[0] is the 'key' I will use) variable in populated dropdown menu

information from array[0] populates form

user changes form data

push submit and form fields update array[] and therefor the line of text that was grabbed to be edited.

```

Do I need to use 2 arrays? One to hold the KEY and then another that is linked to the KEY holding the data in order to populate the form field?

or… and how can i over-write one line of a text file?

Thanks for any ideas!
