New to StackExchange, I'm sorry for the mistakes.
I have an input file that needs to be copied to another file, before the last character.
inputfile.txt:
input {
"inputstuff"
}
filetowriteto.txt:
Stuff {
foo {
"foostuff"
}
bar {
"barstuff"
}
}
After running the script, the resulting file should now be:
filetowriteto.txt:
Stuff {
foo {
"foostuff"
}
bar {
"barstuff"
}
input {
"inputstuff"
}
}
Basically script copies the set of rows inputand inserts them directly before the last right parenthesis in filetowriteto.txt.
The script cannot count on the number of lines, because it filetowriteto.txtdoes not have the predictive number of lines foo or bar, and I do not know how to use sed or awk for this.
source
share