S
S
SpeakeazyYT22018-03-19 16:10:37
HTML
SpeakeazyYT2, 2018-03-19 16:10:37

How to separate a single div block with all the content in it's html code from all the code in which this div is located?

Hello. There are many html files (70 pieces) and html code in it, such is the plan: https://pastebin.com/LVSEx8em . It is necessary to automatically separate the block that starts with a link from line 27 and ends on line 129 from other code, that is, so that only the block remains in the files. How to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WTERH, 2018-03-19
@Expany

Google find and replace text in files?
Literally the first result: solution for Total Commander

S
Sanches, 2018-03-19
@Sanches

If the positions of these blocks in the files do not change, then you can run the `sed` utility:
1. Download the utility: https://github.com/mbuilov/sed-windows
2. Insert the script into the `cmd` file: https://pastebin .com/5wA16DTB
3. In the SETTINGS block, specify the beginning and end of the block and the path to the downloaded utility
4. Drag the folder with the necessary files to the resulting `cmd`
5. Cropped html files will appear in the `out` folder
Well, or in any other way, execute command over each file, substituting the desired line numbers:
sed -n "27,129p" in.html > out.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question