Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Oct 2006 00:02:23 -0500
From:      Lane <lane@joeandlane.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: altering text files.
Message-ID:  <200610270002.23944.lane@joeandlane.com>
In-Reply-To: <574f7c8f130196ac795de5b950d3dcca@prodigy.net>
References:  <574f7c8f130196ac795de5b950d3dcca@prodigy.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 26 October 2006 23:38, jekillen wrote:
> 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
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"

Jeff,

man sed

is your friend.

awk is awkward, but it may be useful as well

lane



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610270002.23944.lane>