Skip to main content
Fix formatting (esp. of "file1" example), remove irrelevant tag
Source Link
AdminBee
  • 23.6k
  • 25
  • 55
  • 77

replace Replace first 7 lines of one file with the othercontent of another file

I've two files the one. One is called file1.txt and the other is person1.txt both. Both of them containscontain some lines of text

file1.txt

word2
word3
word4
word5
word6
word7
word8
word9

person1.txt as in the following example:

givi sixarulidze
  • file1.txt
    word1
    word2
    word3
    word4
    word5
    word6
    word7
    word8
    word9
    
  • person1.txt
    givi sixarulidze
    

whatWhat I want to do is to replace first seven lines of code in file1.txt with the content of person1.txt

target output:

file1.txt

givi sixarulidze
word8
word9
  • Desired output:
    givi sixarulidze
    word8
    word9
    

any solutions will be appericatedHow can I achieve that?

replace first 7 lines of file with the other file

I've two files the one is called file1.txt and the other is person1.txt both of them contains some lines of text

file1.txt

word2
word3
word4
word5
word6
word7
word8
word9

person1.txt

givi sixarulidze

what I want to do is to replace first seven lines of code in file1.txt with person1.txt

target output:

file1.txt

givi sixarulidze
word8
word9

any solutions will be appericated

Replace first 7 lines of one file with content of another file

I've two files. One is called file1.txt and the other is person1.txt. Both of them contain some lines of text as in the following example:

  • file1.txt
    word1
    word2
    word3
    word4
    word5
    word6
    word7
    word8
    word9
    
  • person1.txt
    givi sixarulidze
    

What I want to do is to replace first seven lines of code in file1.txt with the content of person1.txt.

  • Desired output:
    givi sixarulidze
    word8
    word9
    

How can I achieve that?

Became Hot Network Question
edited tags
Link
Kusalananda
  • 355.9k
  • 42
  • 735
  • 1.1k
added 73 characters in body
Source Link
givi
  • 47
  • 3

I've two files the one is called file1.txt and the other is person1.txt both of them contains some lines of text

file1.txt

word2
word3
word4
word5
word6
word7
word8
word9

person1.txt

givi sixarulidze

what I want to do is to replace first seven lines of code in file1.txt with person1.txt

target output:

file1.txt

givi sixarulidze
word8
word9

any solutions will be appericated

I've two files the one is called file1.txt and the other is person1.txt both of them contains some lines of text

file1.txt

word2
word3
word4
word5
word6
word7
word8
word9

person1.txt

givi sixarulidze

what I want to do is to replace first seven lines of code in file1.txt with person1.txt

any solutions will be appericated

I've two files the one is called file1.txt and the other is person1.txt both of them contains some lines of text

file1.txt

word2
word3
word4
word5
word6
word7
word8
word9

person1.txt

givi sixarulidze

what I want to do is to replace first seven lines of code in file1.txt with person1.txt

target output:

file1.txt

givi sixarulidze
word8
word9

any solutions will be appericated

Source Link
givi
  • 47
  • 3
Loading