How to extract hhp file from a chm file - chm

I have an A.chm file for my windows application which runs as expected.
When I decompile it using HTML workshop I get set of html files, .hhc file, .hhk file. When I compile another file B.chm from these extracted files without changing any of the files.((I want to add more html contents to this file but looks like I am losing some information after decompiling)) The output file I get is 72K where as the original file was 75K. B.chm's contents look all file when viewed in the chm viewer but the behavior is lost when when used with the application.
After reading around I found that if .hhp can be extracted from a .chm file then it can be re-constructed as it is without losing any mapping or aliases. Is that true?
How can I extract .hhp file from a .chm file?
Thanks,
Sam

No, Yes , and no.
The original hhp can't be guaranteed extracted
however since chm is an archive type, the project could have added all project files to the archive. I assume you already would have found them if that were the case.
If the decompile process does its administration, it can regenerate the .hhp to a certain degree.
Comments and #define names will probably be lost though, maybe more, but that should not result in problems when recompiling.
But of course it could be that the decompiler is limited. You could try some other (search for something from "keytools").
If not, then take "chmlib" and start drilling down into the format.

Related

What is the difference between a .JSON file and .JL file?

I have both JSON file and JL file on my computer but when I open them in Notepad their structure looks like the same. What is the difference between them? where shall I use each one?
Actually, the time that I was asking this question I didn't know that "the file type is no guarantee of what is inside it". in other words I thought that for every file name there is a separate manifesto and if a files name is ".something", there is a unique manifesto for it. But now I know that I can create a file, write anything that I want into it and name it ".peyman" and yes there is nothing special with it!
What was that file? the file was JSON Lines file format.
Where did I find it? in the Scrapy except writing scrapy crawl name -o file.json I saw that somebody wrote scrapy crawl name -o file.jl. I tried that and the file was 99% like JSON file so I wondered and asked this question here.
So:
What is the difference between a .JSON file and .JL file? Now I know that the better question is "What is the difference between a .JSON file and .JL file in the Scrapy?"
The JSON Line is like JSON but without the "[" and "]" at the
beginning and the end. it is used in the Scrapy because of this
There's quite a few things that a jl file extension could be referring to. If I remember correctly, it originally had something to do with the window manager Sawfish.
Sawfish was developed in Lisp, and the jl file was a Lisp source file for Sawfish. However, I'm guessing (because you said that inside was JSON-like sauce) that's not what you're asking about.
In that case, I do recall a few projects on GitHub... JSON lambda and Julia.
Both of those may be the reason why you're seeing JSON in a jl file. Without more information on where you got that file, or what it was part of, though, we won't be able to help you much.
That said, file extensions rarely matter in terms of Linux. In Windows, they're far more important, but in Linux you could literally append anything to a file as an "extension" (ie. thisfile.whatever) and you could still open it up in an editor. The same is true for most editors in Windows.
Likely, the packager of that file decided on jl for their own reasons, rather than following convention of using .json.
I guess JL extension is used for many purposes, but JL is also one of the few extensions used for JSON-lines (also known as NDJSON or JSONL).
This format can contain multiple JSON values, one JSON value (with "compact" formatting) per line and is useful for e.g. streaming or logging.

Chrome extension how to append or edit a csv file on pc

I am able to find some information on how to read a csv file on a computer but is there any way I can modify one? In my chrome extension I need to add data to each row one at a time after scraping some websites. Is there any better way then read csv, store data as variable and rewrite is everytime? This becomes problematic when the file gets large. I am looking for a way to “append ” to a existing file or a work around. Any suggestions appreciated.
Update: From comment I see it is not possible to read from file system. But is there anyway to read from within the extension directory? How should I do so if the csv file is included with in the zip file of the extension? Can I access them somehow? Code snippets would be helpful.
I'm in the middle of creating something which might help you. Right now you can upload the CSV file and append a "modifier". You can adjust the code according to your requirement. Here's the repo https://github.com/amanrOnly/CSV_Modifier

Recompile CHM file

I'm working on a script that should be able to add additional information to a .chm file.
After decompiling it with hh.exe -decompile outputFolder fileName.chm command, I get the html files, and other 2 files with .hhc and .hhk extension.
After editing the html files, I'd like to recompile the files into a single .chm file. I read that that I also need a .hhp file in order to do that, but that's not generated in the decompilation process.
How can I solve this?
This is a problem of Compiled Help Modules (CHM). And yes - you need a *.hhp for compiling again by HTMLHelp Workshop or e.g. FAR HTML.
You know, you can use 7Zip or just open a command prompt window on a Windows PC and type the following:
hh.exe -decompile <target_directory> <path>\<filename>.chm
The only decompiler with any additional features is KeyTools as this can try to rebuild the project (.hhp) file. You'll need this file if you want to recompile the help project.
One thing to note is that the decompile/recompile process isn't a "round-trip" process. Certain features that the help author added to the original help file can't be recovered when you decompile it, so these may no longer work properly after you've recompiled.
This is especially true in the area of context-sensitive help, which may be broken in the new version of the file.
It can be useful, to include the .hhp file itself - after regenerating is done - into the section [FILES] of the project file (.HHP). Thus, this is included in the Compiled Help Module (CHM) when compiling. The appropriate *.HHP file then is decompiled in addition to the other files for future use.

Creating a CSV file with the Report Generation Toolkit in Labview

I want to create .csv files with the Report Generation Toolkit in Labview.
They must actually be .csv files which can be opened with Notepad or something similar.
Creating a .csv is not that hard, it's just a matter of adding the extension to the file name that's going to be created.
If I create a .csv file this way it opens nicely in excel just the way it should, but if I open it in Notepad it shows all kind of characters and it doesn't even come close to the data I wrote to the file.
I create the files with the Labview code below:
Link to image (can't post image yet because I've got to few points)
I know .csv files can be created with the Write to Spreadsheet VI but I would like to use the Report Generation Toolkit because it's pretty easy to add columns and rows to the file and that is something I really need.
you can use the Robust CSV package on the lavag.org forum to read and write 2D arrays to CSV files.
http://lavag.org/files/file/239-robust-csv/
Calling a file "csv" does not make it a CSV file. I never used the toolkit to generate an Excel file, but I'm assuming it creates an XLS or XLSX file, regardless of what extension you give it, which is why you're seeing gibberish (probably XLS, since it's been around for a while and I believe XLSX is XML, not binary).
I'm not sure what your problem is with the write spreadsheet VI. It has an append input, so I assume you can use that to at least add rows directly to a file, although I can't say I ever tried it. I would prefer handling all the data in memory explicitly, where you can easily use the array functions to add rows or columns to the array and then overwrite the entire file.

CHM file unreadble if saved to hdd

I've just downloaded JSon.Net for framework 4.0 as a zip file.
Opening zip (using WinRar) I'm able to open Documentation.chm file by double-clicking over the name listed and the help file is well done.
Anyway if I extract this file to hdd and I open it, help is unreadable.
Sounds silly, but it's happening.
Thanks for your help!!!
EDITED:
Another tip: unreadble chm file is located in D:\.... (second NTFS partition of first hdd); if I save it on my desktop, chm file becomes readable !!! Crazy...
------------------------------------
---------- SOLUTION ----------
------------------------------------
I answer my question to close it and to help someone who finds in my same trouble.
Using tip suggested by #Marco van de Voort I searched Google for "chm unblock" and found this link:
Your CHM files are stored in the folder with '#' (hash) character in
the path Many C# developers discovered that their documentation
and e-books in CHM format cannot be read because they were storing
their CHM files in the directories like 'C:\E-books\C#\'. The hash
character signifies an anchor in HTML so the CHM viewer fails to
resolve the path properly and to retrieve the content.
That was my problem: I had path with a #... and I'd never thought this could be a great mess for CHM files!!!
Thanks to SO mates for the help given !!
Windows keeps track of downloaded files on NTFS systems, and puts certain restrictions on them. If you extract with windows explorer, this status propagates from archive to file. Using a third party tool (winrar in your case, I use INFO zip) can circumvent this.
Some descriptions and other links can be found
http://wiki.lazarus.freepascal.org/chm_backend_for_fpdoc#Troubleshooting
Free Pascal (2.4.4) has some tool to unlock them. (chmls unblock). It is done by truncating an alternate filestream (therefore it only works with NTFS). I found this info somewhere on stackoverflow, but can't quickly find the link.
It might be that virtual folders like desktop don't fully support this.
maybe the references to some content is to web or no chm file. maybe if you can disassamble in CHM editor and change paths can fix it.
maybe this can help you
There are security permissions applied to this file type by a recent patch.
you need to unblock the file:
http://www.helpscribble.com/chmnetwork.html
instead of thinking many possibilities of "windows security permission", get a CHM reader or wrap your CHM using winrar, and doubleclick to view it like you did.
It's save your time a lot!!
So, two simple solutions are:
have a CHM reader: https://blog.kowalczyk.info/articles/chm-reader-viewer-for-windows.html
OR right click CHM file/s, > Add to RAR Archive.
If you want to read it, double click RAR file > double click CHM file. BINGO!!