ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

REQ: Convert/Export Certain Browser's "Groups" as Chrome Bookmarks

<< < (4/5) > >>

Cocoa:
Hey, 4wd

I had both the script and the shortcut in the same folder and you had said I didn't need to change anything if I did that. After I followed your instructions in the latest post and amended the target path in the shortcut properties to

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -File "C:\Temp\CGP2HTML\v3\CGP2HTML.ps1"
(Which is where I stored both the script and the shortcut)

I got the same result as before, a white blinking cursor in a powershell window with nothing else.

I decided to try updating Powershell to 4.0, the version that was in your system, Windows 8.1. This time, the cursor window also brought up a box to choose a folder, similar to your screenshot.

I pointed it to the folder where the cgp files were stored, the conversion happened, then a prompt said "conversion finished, press any key to exit".

I did that.

The problem now is... I can't find the html file that was supposed to be generated after that. It's not in the cgp folder, or in the folder where the script was. I ran it a second time with the updated files in your previous post, same result. I tried using Windows Search to do a full hard drive search for the file, but since I turned off indexing, don't know the file name, and have no other more advanced file search tool, it's likely trying a needle in a haystack. Where is the html file??

4wd:
I decided to try updating Powershell to 4.0, the version that was in your system, Windows 8.1. This time, the cursor window also brought up a box to choose a folder, similar to your screenshot.-Cocoa (June 30, 2015, 07:59 PM)
--- End quote ---

I guess it does use something particular to Powershell v4, I suppose I should test for that.

I pointed it to the folder where the cgp files were stored, the conversion happened, then a prompt said "conversion finished, press any key to exit".

I did that.
--- End quote ---

Don't take it the wrong way but a small piece of advice: read slower ;)



The file will be named CGP2HTML-YYYYMMDDHHMMSS.html and will be in the parent of the folder you chose, (or if it was a root folder it will be in that).  See update.

And no, it won't appear as yellow on blue, that's just the highlighter of the screen capture program :)

UPDATED:
Added: Colour output
Added: Check for Powershell version
Fixed:  Output is to the selected folder

Cocoa:
(^ ^!) I think with about a hundred lines flashing past in the span of a few seconds for all the cgps I had to convert, I would need to have super humanly fast reading speed, rather than slower, to catch that 1 line at the beginning. I did check the the last few lines very carefully to look for some info on the final conversion results, as that's where the info usually is, but unfortunately didn't expect that to be at the very beginning or I would have tried to go back and see it.

I've tested importing and all has gone very smoothly this time. As far as I can tell, the nearly a thousand urls and their names in all the groups are accounted for and any Japanese or Chinese characters have also been transferred intact.  Even the non-Romance file names of the cgp groups have been handled just fine. ;D

Thank you so much, 4wd for all your work and unwavering support that finally created this tool. Being able to retain all the urls and info collected over the years is invaluable and I have thoroughly enjoyed the process of our tackling the challenges together.  :D

In case you or anyone else feels like adding additional features in the future, such as reverse converting back from html to cgp, I'll still more than welcome them.

BTW, I'm curious about the workings of the program you found that could perform encoding conversions. Could you provide a link to the original?

4wd:
(^ ^!) I think with about a hundred lines flashing past in the span of a few seconds for all the cgps I had to convert, I would need to have super humanly fast reading speed, rather than slower, to catch that 1 line at the beginning.-Cocoa (July 01, 2015, 02:39 PM)
--- End quote ---

DOH!  Sorry, forgot I was dealing with a serial bookmarker  ;D

UPDATED: I've moved it to the bottom.

In case you or anyone else feels like adding additional features in the future, such as reverse converting back from html to cgp, I'll still more than welcome them.
--- End quote ---

Should be easy enough to go the other way since the .cgp format is even simpler.

BTW, I'm curious about the workings of the program you found that could perform encoding conversions. Could you provide a link to the original?
--- End quote ---

I didn't need it, Powershell does the necessary conversion - all you need to do is tell it what the input character encoding is (in this case gb2312 - here's a list) and what output encoding you want (UTF-8).

I was going to use the other program if I continued on with using a normal command file.  I've since deleted it but here's a simple Powershell script that does the same thing - paste below into a file called X2UTF8.ps1

There's no error checking, so you need to get encoding and file paths correct.


--- Code: PowerShell ---<#.SYNOPSIS   Converts text files to UTF-8.DESCRIPTION   Reads text file according to encoding specified, saves to UTF-8 file..PARAMETER   <input encoding> - encoding of original file.   <infile>         - file to convert.   <outfile>        - output file.   .EXAMPLE   PS> X2UTF8.ps1 gb2312 input.txt output.txt#> Param(    [String]$Encoded,    [String]$SourceFile,    [String]$Destfile)$Buffer = Get-Content $SourceFile -Encoding byte$Encoding = [System.Text.Encoding]::GetEncoding($Encoded)$String = $Encoding.GetString($Buffer)Out-File -FilePath $Destfile -Encoding utf8 -InputObject $String
Open a Powershell console and call as: .\x2utf8.ps1 <encoding> <input file> <output file>

eg.  .\X2UTF8.ps1 gb2312 D:\test\12_31-03.47.29.cgp K:\test.txt

4wd:
In case you or anyone else feels like adding additional features in the future, such as reverse converting back from html to cgp, I'll still more than welcome them.-Cocoa (July 01, 2015, 02:39 PM)
--- End quote ---

Something for you to test: HTML2CGP

Still in Powershell, has a simple GUI:



Extract all files to a folder somewhere and double-click the shortcut to run.  You should see the normal PoSh command window open then hide and then the GUI opens.

Two buttons, self-explanatory, the Output: line will have simple instructions, (choose file/folder), progress messages, (converting file xxx, etc), as well as show where the output went.

I've changed it so that it uses whatever the system character encoding is for the input and output, (at least I think I have, it's a bit hard to test since I'm stuck with English :) ).

eg. If your system is set for Simplified Chinese then it should read/write the .cgp files in that language.  However, if your system is set for OEM437, (or something), and the files are Simplified Chinese characters and ANSI encoded, then you'll get something indecipherable.

That's what I got anyway, even though I'm set to OEM850 the output files were byte identical to the original input files after converting to HTML and then back to CGP, so in theory it should work.

Requires Powershell v4, should open a requester if you haven't got it (haven't got anything to test it on).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version