Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #164868

Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files?

From Andy Burns <usenet@andyburns.uk>
Newsgroups alt.comp.os.windows-10, alt.comp.microsoft.windows, alt.msdos.batch
Subject Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files?
Date 2022-12-19 09:48 +0000
Message-ID <k0aqcaFsp2rU1@mid.individual.net> (permalink)
References <tnp4n3$jrm$1@gioia.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


Andy Burnelli wrote:

> How can one most easily insert contents of a file (or a line of text)
> at a given line-number location inside each of hundreds of text files?

https://www.gnu.org/software/sed/manual/sed.html

sed -i '22i This is your new line 22' filename.txt

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Andy Burnelli <spam@nospam.com> - 2022-12-19 07:43 +0000
  Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Jeff Barnett <jbb@notatt.com> - 2022-12-19 00:53 -0700
    Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Paul <nospam@needed.invalid> - 2022-12-19 05:32 -0500
      Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Andy Burnelli <spam@nospam.com> - 2022-12-19 16:36 +0000
        Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Paul <nospam@needed.invalid> - 2022-12-19 12:53 -0500
      Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Herbert Kleebauer <klee@unibwm.de> - 2022-12-20 19:15 +0100
    Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Chris <ithinkiam@gmail.com> - 2022-12-20 11:23 +0000
  Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Andy Burns <usenet@andyburns.uk> - 2022-12-19 09:48 +0000
  Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? "Kerr-Mudd, John" <admin@127.0.0.1> - 2022-12-19 09:50 +0000
    Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Big Al <Bears@invalid.com> - 2022-12-19 10:42 -0500
  Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? Herbert Kleebauer <klee@unibwm.de> - 2022-12-19 22:51 +0100
  Re: How to insert contents of a file (or a line of text) at a given location inside hundreds of text files? "R.Wieser" <address@not.available> - 2022-12-20 09:16 +0100

csiph-web