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 > "[EMAIL PROTECTED]"
Jeff, man sed is your friend. awk is awkward, but it may be useful as well lane _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"