Insertar saltos de pagina en un fichero

Hi,
I need help urgently.
Something that seems simple, does not come out.
Attempt to insert into a text file page breaks. I need that the execution is fast (as I have to change many files and very large).

I have tried using the sed command to replace the characters "C$" with "\f"C$, but there is no way, doing it this way:

sed 's/C\$/&\f+/g' prova.txt

It does not work because it replaces the characters "C$" for "f+".

Please, this should be very easy anyone can help me? :o

Try this:

sed 's/C\$/f+/g' file

I've tried and not working

FF=`echo "\0014\n"` # Form feed
sed -e "s/C\$/${FF}/g" oldfile > newfile

If this doesn't work, please post the output from the diagnostic view of an example end of page record displayed with the following command:

sed -n l filename

This should reveal if what you see as "C$" is actually something else?

nawk '{gsub("C\\$", "\f&");print}' myFile

has worked!!

many thanks !! :slight_smile:

---------- Post updated at 05:32 AM ---------- Previous update was at 05:29 AM ----------

It worked but performs the operation in various parts:

FF=`echo "\0014\n"` # Form feed
sed 's/C\$/PAGINAnova&/g' file1> file2
sed -e "s/PAGINAnova/${FF}/g" file2 > file3

many thanks !!

---------- Post updated at 05:33 AM ---------- Previous update was at 05:32 AM ----------

has worked!!

many thanks !!