Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging multiple html’s #31

Open
Suiko25 opened this issue Sep 7, 2021 · 8 comments
Open

Merging multiple html’s #31

Suiko25 opened this issue Sep 7, 2021 · 8 comments

Comments

@Suiko25
Copy link

Suiko25 commented Sep 7, 2021

Not sure if you are still working on this but I must say it is a great little program so much so I had to donate. I wonder if there is any progress in merging the html files? I have plenty of HDD snap2html files I would love to batch together but have had no luck trying to join them.

Thank you for great app

@Suiko25 Suiko25 changed the title Have tab for destination of the file that has been searched. Merging multiple html’s Sep 9, 2021
@predb
Copy link

predb commented Jul 16, 2022

I have multiple Hard Drives too, and only use this to find duplicate files in all Snapfiles, Thought of a temporary solution, which works well.

select all snap files,

open in with NotePad++,

Ctrl+F, Find All In All Opened Documents, Done.

@Zhuoy3
Copy link

Zhuoy3 commented Feb 15, 2023

I wish to merge multiple html of different Hard Drives too.

This do not seem to be provided, so I wrote a python script to do it. But it seems a little too complicated...

Could not seem to post the script

Snap2HTML-Merge.zip

could list all the files that need to be merged in the parameters, or do not add any parameters. With no arguments, all possible files in the current directory will be retrieved

@DJ-Dingo
Copy link

Nice work @Zhuoy3. Make searching 30+ hard drives much easier.
However, it will sometimes crash the browser when you, like me, have such a large amount of data in small files, but i can live with that. Thanks for sharing

The only thing i miss is also having the name of the Hard Drive to the left, (as many of my HDD uses the same drive letter).

And also which HDD the various searches match. Either split up for each HDD, or a designation about (HDD Name) based on each file/folder found.

But love what you have done so far thx :-)

@Zhuoy3
Copy link

Zhuoy3 commented Feb 15, 2023

The only thing i miss is also having the name of the Hard Drive to the left, (as many of my HDD uses the same drive letter).

it's not a hassle, you can line 156 from

merge_file = re.sub("^D\.p\(\[\"", f"D.p([\"{new_name_root_path}/", merge_file)

to

merge_file = re.sub("^D\.p\(\[\"[A-Z]:\/", f"D.p([\"{new_name_root_path}/{os.path.basename(file_name).rstrip('.html')}/", merge_file)

like it Snap2HTML-Merge.zip

This will change the Drive name to the input file name.

I don't experience crashes, maybe because I only have a dozen files?

@DJ-Dingo
Copy link

This will change the Drive name to the input file name.

I don't experience crashes, maybe because I only have a dozen files?

Yes thanks alot, thats works better for me.
I do miss the Drive letter then, can we have both? :-)

I have also just found out that I am now missing the link funktion to each file.

The crashes is probably because some of my HTML files take up 150mb each. But i can live with them as a standalone seach, since I know that those hard drives contain many very small files. And many of those files are not ones I need to search anyway..

@Zhuoy3
Copy link

Zhuoy3 commented Feb 15, 2023

Yes thanks alot, thats works better for me. I do miss the Drive letter then, can we have both? :-)

An easy way is to not remove the drive name, but this is not very elegant

merge_file = re.sub("^D\.p\(\[\"", f"D.p([\"{new_name_root_path}/{os.path.basename(file_name).rstrip('.html')}-", merge_file)

Since re.sub cannot capture variables simply, further adjustments need to be slightly complicated: Snap2HTML-Merge.zip

drive_name = re.search("^D\.p\(\[\"([A-Z]):\/", merge_file).group(1)
base_name = os.path.basename(file_name).rstrip('.html')
new_name_index = f"{drive_name}:({base_name})"
merge_file = re.sub("^D\.p\(\[\"[A-Z]:\/", f"D.p([\"{new_name_root_path}/{new_name_index}/", merge_file)

You can modify new_name_index to the style you want.

I have also just found out that I am now missing the link funktion to each file.

It's true. I remove it, because I don't found a way to preserve file links while merging files from multiple drives. This may be due to the parameter linkRoot of Snap2HTML.

And modifying the drive name will also destroy the file links.

@DJ-Dingo
Copy link

I have also just found out that I am now missing the link funktion to each file.

It's true. I remove it, because I don't found a way to preserve file links while merging files from multiple drives. This may be due to the parameter linkRoot of Snap2HTML.

And modifying the drive name will also destroy the file links.

Thank you very much, this works really well for my workflow (Finding specific samples when making music).

I can now quickly find all the HDDs with specific samples and duplicates that I'm looking for, and then just load the simple HTML for only those drives with links. You just saved me hours of work doing the search every time I use this.

I usually use "adsr sample manager" for my samples but don't want ALL my 30+ HDDs of samples inside that program. And it does not work so well when the HDD is not attached to the computer. But Snap2HTML and your script makes up for it.

Nice work @Zhuoy3

@kidzgy
Copy link

kidzgy commented Mar 18, 2024

Snap2HTML.zip
Source: https://www.52pojie.cn/thread-1814029-1-1.html

2024-03-18_222735

This modified version can merge html files.

Usage:

1, you must use this modified program graphical interface to generate new html, the official version or command line generated html in the merger will have problems.
2、After generating multiple htmls, copy all the lines with D.p([ at the beginning of one of them to the next line of the last line of D.p([ in the other html (or the previous line of delete(Array.prototype.p)).

The rendering is as follows:

20240318223518

Currently identified issues:

Using html generated from the command line or the official version, there is a problem when copying over the D.p([ segment of code, causing the new merged file to not be viewed properly.
I don't know why the html generated by the command line and the html generated by the GUI are different in this modified version.

Hopefully the author can fix this.

I think the idea of this modified version is quite good, I hope the official version can learn from it, so that the official version can directly support merging multiple html files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants