Skip to content
Advertisement

Change position of a line with a specific string, using python

I am new to coding, trying to find a simple python code for re-arranging some lines. Lines have specific string to select. Those lines with this specific string need to be moved.

Original File content:

JavaScript

Note: the attribute line with “last” in it, this whole line should go to the end of each element’s attribute list.

New file format:

JavaScript

Appreciate any help on this.

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement