🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17288

Modifying data in a text file

#17288
From: Michael Andres
Date: Wed, 25 Nov 1998 00:00
16 lines
894 bytes
Hi,

   A presumably easy question.  What is the best way to modify an
existing line of text in a file?  I need to create a method to change a
users password.  They file is as such:

user1 passwd1
user2 passwd2

How do I change, for example, user1's password to:

user1 newpasswd

leaving the rest of the file unchanged?

-mike
Technical Details
Message-ID: <365C7288.E1E3B20E@tc.umn.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,7ee9637438b194e8,start
X-Google-Attributes: gidf74b3,public
From: Michael Andres <andr0023@tc.umn.edu>
Subject: Modifying data in a text file
Date: 1998/11/25
Message-ID: <365C7288.E1E3B20E@tc.umn.edu>
X-Deja-AN: 415595923
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Reply-To: andr0023@tc.umn.edu
Newsgroups: borland.public.jbuilder.java.language