View Single Post
Posts: 235 | Thanked: 86 times | Joined on Dec 2010
#7
Originally Posted by taixzo View Post
What exactly does this line do:
Code:
vim -c ':/description' -c ':.-1' -c ":1,. d" -c ":.+1" -c ":.,$ d" -c ":wq!" ${file_prefix}.html
I'm trying to implement this in Python.
-c ':/description' => find 'description'
-c ':.-1' => goto previous line
-c ":1,. d" => delete all lines from beginning to current line (1 line before 'description')
-c ":.+1" => goto next line
-c ":.,$ d" => delete all lines all to the end
-c ":wq!" => save

basically it extracts the expected answer from the result HTML using 'description' as keyword
 

The Following 5 Users Say Thank You to figaro For This Useful Post: