1
Good afternoon,
I am trying to read from an X file and write to a Y file when a specific String appears. But I only want to include it once. Example I’m trying to make:
sed -i '/, pasta/r teste.txt' Report.html
This command is reading all the strings ", folder" and is including below the contents of the test.txt file. But I want to make it include only the first occurrence of the string ", folder" . A command like:
sed -i '0,/, pasta/r teste.txt' Report.html
The above syntax is wrong, as it would be correct to include the contents of the file only in the first occurrence of the string ", folder" ?
but I would like to make the substitution, I got with the command:
sed -i $(awk '/, past/{print NR;exit}' Report.html)'r test.txt' Report.html
– Rakiz
It seems to me that you are not solving the request.
– JJoao