From owner-freebsd-questions@FreeBSD.ORG Mon Nov 10 18:29:09 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0533C1065673 for ; Mon, 10 Nov 2008 18:29:09 +0000 (UTC) (envelope-from dannyman@toldme.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by mx1.freebsd.org (Postfix) with ESMTP id DAAEA8FC1E for ; Mon, 10 Nov 2008 18:29:08 +0000 (UTC) (envelope-from dannyman@toldme.com) Received: by rv-out-0506.google.com with SMTP id b25so2495447rvf.43 for ; Mon, 10 Nov 2008 10:29:08 -0800 (PST) Received: by 10.143.11.11 with SMTP id o11mr2564999wfi.193.1226341748364; Mon, 10 Nov 2008 10:29:08 -0800 (PST) Received: by 10.142.87.13 with HTTP; Mon, 10 Nov 2008 10:29:08 -0800 (PST) Message-ID: <2a5241e00811101029g6f2501b4t395e30b5d10a1212@mail.gmail.com> Date: Mon, 10 Nov 2008 10:29:08 -0800 From: "Daniel Howard" To: bsd In-Reply-To: <4B1A9F30-B8BC-4C48-A85F-3697C6AB3B7B@todoo.biz> MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4B1A9F30-B8BC-4C48-A85F-3697C6AB3B7B@todoo.biz> Cc: Liste FreeBSD Subject: Re: scripting text replacement 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: Mon, 10 Nov 2008 18:29:09 -0000 On Sat, Nov 8, 2008 at 10:43 AM, bsd wrote: > I have a file containing a list of items like that: > > line1item1 line1item2 line1item3 > line2item1 line2item2 line2item3 > =85400 times > > I need to insert this into another text file using printf() items should = be > converted into variable looping=85 like that: > > printf "Bla bla bla $1 bla bla $2 bla bla $3 bla bla $2" awk '{print "Bla bla bla "$1" bla bla "$2" bla bla "$3" bla bla "$2}' < file.txt > file-bla-bla-bla.txt -d --=20 http://dannyman.toldme.com