I have the intention of inserting into the files .py
the following section:
-*- encoding: utf-8 -*-
It needs to be specific online, and in large amount of files.
Is there any unix / linux tool that can perform this task?
I have the intention of inserting into the files .py
the following section:
-*- encoding: utf-8 -*-
It needs to be specific online, and in large amount of files.
Is there any unix / linux tool that can perform this task?
To insert this line, use the command sed :
sed -i '2i-*- encoding: utf-8 -*-' arquivo.py
-i
saves edits to the file itself 2i
i nsere the string in the second line To do this in all python files in the same folder, replace arquivo.py
with *.py
. You can use other wildcard characters .