Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Plugins Page: 1... 36 37 38 39 40 ...52  Previous   Next
New Plugin: BulkEdit - Bulk Editing, XML and CSV Import of Profiles
Author Message
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Thanks Mithi. I might be able to include XSL math. I am looking at supporting as many as possible. This is actually quite a lot of fun for me.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Quoting ljckbailey:
Quote:
It looks like in the process of moving data between your BulkEdit sheet & excel, etc profileid's have been corrupted by excel - removing leading zeros and by rounding exponentializing others . . .

ahhhhhh

I correct a few by hand to verify that that is the issue . . . then start over.

Thanks

In fact warned you about this, and also in the BulkEdit documentation. You have to set the ProfileID field to Text before importing in to Excel, and make sure the field is formatted correctly before saving as CSV again.

Also, don't forget the "M" in the manual profile - this was also in my examples.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Unlimited Registrantljckbailey
Registered: March 20, 2007
Posts: 17
Posted:
PM this userView this user's DVD collectionEdit postDirect link to this postReply with quote
Quoting mediadogg:
Quote:
Quoting ljckbailey:
Quote:
It looks like in the process of moving data between your BulkEdit sheet & excel, etc profileid's have been corrupted by excel - removing leading zeros and by rounding exponentializing others . . .

ahhhhhh

I correct a few by hand to verify that that is the issue . . . then start over.

Thanks

In fact warned you about this, and also in the BulkEdit documentation. You have to set the ProfileID field to Text before importing in to Excel, and make sure the field is formatted correctly before saving as CSV again.

Also, don't forget the "M" in the manual profile - this was also in my examples.


Wasn't laying blame . . . was completely my fault.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
That's OK, I couldn't find where I warned you - I usually do, but I guess this time I forgot.

I'm still a bit confused about your process. I have been testing by executing Math on separate Location and Slot values, and then generating corresponding new values of Location and Slot.

But your CSV puts everything in Location, and Slot is blank. It that what you intended?

It doesn't matter, because you should be able to do it either way with the Math feature.

But just for my understanding ...
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Unlimited Registrantljckbailey
Registered: March 20, 2007
Posts: 17
Posted:
PM this userView this user's DVD collectionEdit postDirect link to this postReply with quote
Hey mediadogg,

Just wanted to let you know that I successfully imported personal (disc,location,slot,collection#) for all of my ~1150 disks last night.

Thank you.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Quoting ljckbailey:
Quote:
Hey mediadogg,

Just wanted to let you know that I successfully imported personal (disc,location,slot,collection#) for all of my ~1150 disks last night.

Thank you.

OMG, you finished even without the Math goodie!

Well, I'm so glad, and I will still complete the Math thing. Because it is fun, and cool. I thank you for the motivation by providing a tasty challenge.

Could you answer my question about the resulting Location and Slot values? For completeness, I want to publish the Math that would have also solved this problem, without needing to import CSV.

Perhaps you can give a few examples of before and after for Location and Slot. I know you have done that before, but somehow I think I have understood two different versions. What did you finally do?

BTW, if you could edit this post to delete the quoting of my announcement, I would appreciate it.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Unlimited Registrantljckbailey
Registered: March 20, 2007
Posts: 17
Posted:
PM this userView this user's DVD collectionEdit postDirect link to this postReply with quote
Quoting mediadogg:
Quote:
Quoting ljckbailey:
Quote:
Hey mediadogg,

Just wanted to let you know that I successfully imported personal (disc,location,slot,collection#) for all of my ~1150 disks last night.

Thank you.

OMG, you finished even without the Math goodie!

Well, I'm so glad, and I will still complete the Math thing. Because it is fun, and cool. I thank you for the motivation by providing a tasty challenge.

Could you answer my question about the resulting Location and Slot values? For completeness, I want to publish the Math that would have also solved this problem, without needing to import CSV.

Perhaps you can give a few examples of before and after for Location and Slot. I know you have done that before, but somehow I think I have understood two different versions. What did you finally do?

BTW, if you could edit this post to delete the quoting of my announcement, I would appreciate it.


I think that you probably understood correctly. However, after some consideration I realized that I was using the slot location out of habit and that my current need for a location string really had no slot and would be better labeled in a single string. So I made the decision to combine both locations bits into a single string. Anyway, I was able to make changes to the collection number at the same time as mine we're kind of a mess. I'm not sure I would have been able to figure out how to do any of that with the math functions. I looked at the math functions and was not able to figure out how it worked. I'm sure I could have with much more study but this was easier for me.

Thanks again.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Thanks for the reply. The good thing about options is that each person can pick the one they prefer to get the job done.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Whew, almost there. 

Finally got both Visual Basic and C# (C Sharp) working combined with Regex. Debugging some loose ends.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
BulkEdit V2.48 Available - Please, Please do not quote this post, as information will be edited.

(V2.47 Withdrawn)

- Additional trapping of Regex errors
- Text entry boxes for Regex expanded (user request)
- Fixed bugs in Regex when applied to Combo boxes and Rich Text fields (e.g Notes, Overview)
- Added Genres to Multi-Copy Tool 1
- Added two optional work columns (Work 1 and Work 2) that are not part of the database
- Added Math to Tool 4 Regex

Regex Math  (Screen Shot)
Quote:
This new feature provides for mathematical computations to be peformed on Regex results prior to updating the spreadsheet. In fact, it is possible to write small applications conforming to either Visual Basic or C Sharp syntax, including File IO and XML processing.

To assist in developing logic within your script, a built-in method called RowData has been provided. It will output a string version of the named column, for the particular row that the script is operating on. For example, RowData("Location") yields the value of the Location field within the selected row. The "Location" field must be displayed in the spreadsheet in order for this to work.

RowData("row") returns the index of the current row, as a string, index 1. RowData("rowcount") returns the number of rows in the spreadsheet. This makes it easy to determine when to do startup processing (e.g. read a file into a memory stream), and final processing (e.g. write the stream back out to a file.) The RowData method simply executes a key search on the global variable rowdatalist (SortedList), which your code can also access directly.

UserData("key") returns a string that you have previously stored associated with the value "key". Since Regex Math is re-invoked on each row iteration (ALL or Next), this is a way for your code to save data between iterations. This may save time by eliminating the need to repeatedly open and close files. A file can be opened when row = 1, some data saved and then processed for subsequent rows, then file output can be done when row = rowcount. User data is saved in the SortedList global variable userdatalist, which your code can manipulate directly.

Two work columns ("Work 1" and "Work 2") can be optionally displayed. Data can be copied from other columns and manipulated before copying back into profiles. In addition, the Regex Math function can be optionally made to output to a work column instead of modifying the original column. This is good for testing or for making more complex scripts, as RowData("Work 1") and RowData("Work 2") are both supported.

Two additional items have been added to the context menu (right click) of the Regex Replace box: "Load Math Script" and "Save Math Script." The default extension for CSharp is .cs and for Visual Basic, .vb.

Syntax Notes
To return a value from the script, a "return" statement (C Sharp) or "Return" statement (Visual Basic) must be used. All code statements are case-sensitive in order to take advantage of built-in Microsoft compilers. C Sharp requires each statement of your script to be terminated with ";", while Visual Basic uses the the "end of line" as the default statement end. Comments can be added to scripts using the standard delimiters for C Sharp ("//" ) and Visual Basic (" ' "). Using C Sharp, you must explicitly convert any returned value to "string", e.g. by using the ToString() method.

Quote:
Disclaimers and Limitations
(1) There has been limited testing, although the code and methods have been derived from existing BulkEdit code. There are numerous tests in an attempt to protect against crashes from ill-formed data, but be careful.
(2) "Using" and "Imports" statements have been established with a test Namespace. In some cases, it may still be necessary to fully qualify references to classes used in your code. Attempts to use unsupported class will result in syntax errors. (Note there is a bug in VB Imports, fixed in V2.48).
(3) It is not possible to interactively debug your code inside the Regex box. It is best to debug more complex scripts prior to using them in BulkEdit. I have attempted to cause meaningful error messages, in the case that scripts need to be adjusted in context.
(4) Regex Math works only on simple Text or Combo fields - not numeric (e.g. disc) or Rich Text (e.g. Notes). If regex Math returns a value that is not allowed in the Combo Box drop-down list, the update will be silently bypassed.

Examples - Pay attention to case, and to use of ";" in C Sharp

(1) xyrano: add a fixed number to collection number, and update

Math box checked. Cursor lies in Collection Number column. Visual Basic.  (optional output to Work 1 or Work 2)
Regex Look For:    (\d+).
Regex Replace:    Return ($1 + 15)

Math box checked. Cursor in Collection Number column. C Sharp  (optional output to Work 1 or Work 2)
Regex Look For: (\d+)
Regex Replace:  return ($1 + 15).ToString();

(2) ljckbailey: Reformat Location and Slot, based on modulo scheme

Math box checked. Cursor in Location Column. C Sharp
Regex Look For: D(\d+)
Regex Replace: (There are many alternate ways to do this)

// Look For in Location, using Regex search D(\d+)
// This Math is the Regex Replace
int slot = int.Parse(RowData("Slot"));
double A = 0;
string media = "";  // This needs tweaking to cover case of disc > 1
if (RowData("Blu-Ray") == "true") media = "Blu-Ray";
else if  (RowData("HD") == "true") media = "HD";
else media = "DVD";
if (slot > 99) { A = Math.Ceiling((double)(slot / 4)); }
else {  A = 1 + Math.Ceiling((double)(slot / 4)); }
double B = ( $1 - 1) * 100;
return media +" ~ "+"Page: "+(A + B).ToString()+"  Disk "+(((slot % 4) == 0)?4 : (slot % 4)).ToString();

Known Bugs

- Known bugs fixed V2.50.

Futures
- Consider a way to update other columns within the script
- A way to interrupt hung script
- Loop counter and length to allow the script to perform start / end processing (Done - V2.50)
- Need a way to save global data between row iterations (Done - V2.50)



Please report any bugs promptly, and I will fix them at the highest priority.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Regex Script Examples (Reserved Post)

(1) Hello World
C#: MessageBox.Show("Hello World");
VB: MessageBox.Show("Hello World")

(2) Load some XML snippet
// C#:
XmlDocument xmldoc = new XmlDocument();
OpenFileDialog getfile = new OpenFileDialog();
DialogResult dr = getfile.ShowDialog();
if (dr == DialogResult.OK) xmldoc.Load(getfile.FileName);
MessageBox.Show(xmldoc.InnerText,"XML Loaded");

'VB
Dim xmldoc As New XmlDocument()
Dim getfile As New OpenFileDialog()
If getfile.ShowDialog() = DialogResult.OK Then
    xmldoc.Load(getfile.FileName)
End If
MessageBox.Show(xmldoc.InnerText,"XML Loaded")

(3) Perform Startup and End Process. Save user data along the way.
// C#:
if (RowData("row") == "1")
{
  XmlDocument xmldoc = new XmlDocument();
  OpenFileDialog getfile = new OpenFileDialog();
  DialogResult dr = getfile.ShowDialog();
  if (dr == DialogResult.OK)
  {
      xmldoc.Load(getfile.FileName);
      userdatalist.Add("myXML", xmldoc.OuterXml);
  }
}
else if (RowData("row") == RowData("rowcount"))
{
  // Do end of loop stuff here, such as write a file
}
else
{
  // Loop processing here, as a result of user "All" or "Next" command and Regex Match
  string myxml = UserData("myXML");  // get the saved data
  XmlDocument xmldoc = new XmlDocument();
  xmldoc.LoadXml(myxml); // Now process the relevant node(s)
  userdatalist.Add("newdata", "Some new data to be saved goes here, to be used later");
}
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
BulkEdit V2.48 Available - Regex Visual Basic now imports most useful classes.

(Superseded by V2.49)
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
BulkEdit V2.49 Available (Superseded by V2.50)
- Additional Regex bugs fixed
- Combo Box (drop-down lists) now supported by Regex Math. Returned value must be a valid value in the drop-down list
- Zoom function in Tool4 Replacewith box by double-click, yields more space for editing
- Math output to either Work 1, Work 2 or Target Column (fixes V2.48 bug)
- The "Use Math" check box is greyed out when not allowed
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
BulkEdit V2.50 Available  (Tool 4 Regex Math, stable release)
- All features of V2.47 - V2.49 rolled up with bug fixes
- Bug fixes to Visual Basic syntax
- RowData("row") and RowData("rowcount") added
- rowdatalist global variable (SortedList object)
- userdatalist global variable (SortedLiist)
- Load / Save script now handles both .cs and .vb
- Save data using global variable userdatalist (SortedList object)
- Retrieve data using UserData("key")

I think I have discovered and fixed the most obvious major bugs, and the functionality now suits me, so I will quit at this point until / unless I get feedback on bugs or function requests.

This Regex Math feature grabbed my imagination, and is so useful that I am considering adding it to a couple of other plugins, namely DVDProfileLoop and / or MyTools.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Unlimited RegistrantStar ContributorMoses277
I'd rather be in the Sun
Registered: March 23, 2007
United Kingdom Posts: 95
Posted:
PM this userView this user's DVD collectionEdit postDirect link to this postReply with quote
Hi Mediadogg,

I keep getting an error message when I open profiler from your plugin.

" Bulk Edit: Could not load file or assembly 'System, Version=4.0.0.0, Culture=netural, PublikKey Token=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified"

Please help me to resolve the problem is I would like to use your plugin on my ordered list.
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,404
Posted:
PM this userVisit this user's homepageEdit postDirect link to this postReply with quote
Quoting Moses277:
Quote:
Hi Mediadogg,

I keep getting an error message when I open profiler from your plugin.

" Bulk Edit: Could not load file or assembly 'System, Version=4.0.0.0, Culture=netural, PublikKey Token=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified"

Please help me to resolve the problem is I would like to use your plugin on my ordered list.

I'll take a look and get back to. Maybe the new stuff requires dll's that I forgot to include in the oackage.

I installed on one of my other machines, and it worked. I have only one "clean" machine (just purchased it), so I will try installing on that one (Windows 8 touch screen).

What version of windows are you running? Are you installing to the default folder? Recent versions of BE automatically uninstall the previous one. But if you had an old, old version of BE installed, maybe you forgot to run the uninst000.exe (shouldn't matter, but it is better if you do.)

I am hoping to get some other user(s) to try it before I bloat the installation package with files that are not needed.

Edit: Just installed DVDP and BulkEdit V2.50 on a brand new machine - Windows 8 x64, and all went as expected. So the jury is still out. I will wait for feedback from you about your environment.

I did Google your error message and found some information, but I am not sure it can be trusted. Perhaps you can do the same and form your own opinion.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
    Invelos Forums->DVD Profiler: Plugins Page: 1... 36 37 38 39 40 ...52  Previous   Next