Python - removing the first two lines of a line

I searched for a lot of threads here, deleting the first two lines of the line, but I cannot get it to work with every solution I tried.

This is what my line looks like:

version 1.00
6992
[-4.32063, -9.1198, -106.59][0.00064, 0.99993, -0.01210][etc...]

I want to remove the first two lines of this Roblox sack file for the script I am using. How can i do this?

+4
source share
4 answers

I don’t know what your final character is, but what about something like

postString = inputString.split("\n",2)[2];

The end of a character can be escaped, but I start with this.

+10
source
x="""version 1.00
6992
[-4.32063, -9.1198, -106.59][0.00064, 0.99993, -0.01210][etc...]
abc
asdda"""
print "\n".join(x.split("\n")[2:])

You can just do it.

+4
source

split:

lines = """version 1.00
6992
[-4.32063, -9.1198, -106.59][0.00064, 0.99993, -0.01210][etc...]"""

lines = lines.split('\n',2)[-1]
+2

, , '[' lines = [line for line in lines if line.startswith('[')]

+1

All Articles