Suoritettu

Help resolve a 7STEPS simple FindReplace Python script

Hi there this is how it looks like BEFORE and AFTER, for the problem am trying to solve using Python. I have been trying for weeks. And am failing so miserable to tell python to do the following:

STEP1: If you find on this document: "LinkedTo=" (Example value: Node_3)

STEP2: Then Stop

STEP3: Go to the previous NodePosX= and copy the value (Example value: 10)

STEP4: Go to the previous NotePosY= and copy the value (Example value: 100)

STEP5: Then find the next "Node_3" on the document

STEP6: And replace inside the NodePosX=30 and NodePosY=300 for the copied values 10 and 100

STEP7: Then look for the next "LinkedTo=" (Example value: Node_5) and repeat the STEP2 to STEP5

This is how it looks like BEFORE runing the Python script:

Begin

Name="Node_1"

NodePosX=10

NodePosY=100

LinkedTo=Node_3

LinkedTo=Node_5

End Object

Begin

Name="Node_2"

NodePosX=20

NodePosY=200

End Object

Begin

Name="Node_3"

NodePosX=30

NodePosY=300

End Object

Begin

Name="Node_4"

NodePosX=40

NodePosY=400

End Object

Begin

Name="Node_5"

NodePosX=50

NodePosY=500

End Object

This is how it should look like AFTER runing the Python script:

Begin

Name="Node_1"

NodePosX=10

NodePosY=100

LinkedTo=Node_3

LinkedTo=Node_5

End Object

Begin

Name="Node_2"

NodePosX=20

NodePosY=200

End Object

Begin

Name="Node_3"

NodePosX=10

NodePosY=100

End Object

Begin

Name="Node_4"

NodePosX=40

NodePosY=400

End Object

Begin

Name="Node_5"

NodePosX=10

NodePosY=100

End Object

Do you think am asking to much from python to do? Any better sugestions for the title to this problem? Best regards!

Taidot: Python

Näytä lisää: python replace string in file regex, python regex replace all, python replace whole line in file, python replace specific line in file, python replace multiple string in file, python replace line in text file, string replace, python list replace string, simple post comment script, simple flash slidshow script, simple server monitor script, python script installieren, simple viewer action script, python script output text file, simple web database script, python script read html page, read csv file using python script, need help write python script operate telit module, create simple python script, write simple python script

Tietoa työnantajasta:
( 0 arvostelua ) Spain

Projektin tunnus: #18804373

Myönnetty käyttäjälle:

alexreichenbach

I'm a computer science major and teacher's assistant. I have a bunch of experience writing and correcting other people's code. Further, I'm just trying to get my first freelancer job, so I'll work on the cheap and stri Lisää

€9 EUR 1 päivässä
(0 Arvostelua)
0.0

3 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön

stevegtdbz

Hello, I am an expert in python programming. Please open a chat with me to discuss further. For previous jobs and reviews check my profile. Thanks

€20 EUR 1 päivässä
(49 arvostelua)
5.2
pinesucceed01

Dear Project Owner, Greetings for the day!! Kindly share more details so as to have a better understanding and an accurate quote. I would also like to have a discussion with you elaborating project requirement Lisää

€23 EUR 1 päivässä
(0 arvostelua)
0.0