From owner-freebsd-questions@FreeBSD.ORG Fri Oct 27 04:37:08 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43D2C16A407 for ; Fri, 27 Oct 2006 04:37:08 +0000 (UTC) (envelope-from jekillen@prodigy.net) Received: from smtp102.sbc.mail.mud.yahoo.com (smtp102.sbc.mail.mud.yahoo.com [68.142.198.201]) by mx1.FreeBSD.org (Postfix) with SMTP id AE3F743D5A for ; Fri, 27 Oct 2006 04:37:07 +0000 (GMT) (envelope-from jekillen@prodigy.net) Received: (qmail 89575 invoked from network); 27 Oct 2006 04:37:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=prodigy.net; h=Received:Mime-Version:Content-Transfer-Encoding:Message-Id:Content-Type:To:From:Subject:Date:X-Mailer; b=pIGZztsCmLwgP+JaKaR58v14/to+pXDeIfj1bZ8zM/wqC7t8P7uCWb3L+EWBg7LWx6ZPyuE5CPFcNof2UDy3X4QolfgZL04ggiZVz1UkzE1SvuX22gBkNDnD+CzGYnHVwfjBy6ePmxnyKv1qQuvmjOL2ysAFMGLq52UHPwQrLGM= ; Received: from unknown (HELO ?75.7.236.228?) (jekillen@prodigy.net@75.7.236.228 with plain) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 27 Oct 2006 04:37:06 -0000 Mime-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: 7bit Message-Id: <574f7c8f130196ac795de5b950d3dcca@prodigy.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: FreeBSD Mailing List From: jekillen Date: Thu, 26 Oct 2006 21:38:40 -0700 X-Mailer: Apple Mail (2.622) Subject: altering text files. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 04:37:08 -0000 Hello fellow FreeBSD users; I have a technical question about text files: Is there a way to edit a text file via a script by searching and replacing small portions of a text file, instead of having to rewrite the whole file for what may be negligible alterations? I'm assuming not, but I'm not really sure. My interest is with any scripting or even compiled language, but specifically the use of php to edit files on a web server. I have created an application for a web client that allows the client to contact their site and make changes to a file that lists event date, title, location, subject. And creates a separate file for details related to each event listing. I'm concerned about allowing the client to edit the listings and detail files in the event that a mistake is made in the data entered from a event posting form. (I don't want to have to manually edit the files for them in this event) So, the idea of correcting the spelling of a word like is when it was spelled it seems over kill (to over write a whole file just to change one character). Thanks in advance; Jeff k