Snapshot script search

I was looking for a script that will take a snapshot of all the guests lit in a cluster. Spoke to upgrade our Dev & Test of the cluster (windows) with SCCM VM and I want to get a snapshot of each of them before the updates.

I also need a script that will remove the shots once the upgrades are made, but I thought that if I take them, it should not be difficult to change the script to remove.

Someone help with this?

Thank you!

Mike

Hi Mike,.

the first script takes a snapshot of all virtual machines powered from your cluster:

$Cluster = "Dev&Test"
Get-Cluster -Name $Cluster | `
Get-VM | `
Where-Object {$_.PowerState -eq "PoweredOn"} | `
New-Snapshot -Name "Before SCCM upgrade" -Description "Snapshot taken before SCCM upgrade" -Memory -Quiesce -Confirm:$False -RunAsync

The second script deletes snapshots taken in the first script:

$Cluster = "Dev&Test"
Get-Cluster -Name $Cluster | `
Get-VM | `
Get-Snapshot -Name "Before SCCM upgrade" | `
Remove-Snapshot -Confirm:$False -RunAsync

Best regards, Robert

Tags: VMware

Similar Questions

  • using snapshot script

    Most the script below for list of snapshots is spent for me (I made a few small changes) and it works fine except that it does not list the creator of the snapshot, but rather as the creator of the last snapshot even if there is not, instant vDP, for example.  In my opinion, it's how the Get-VIEvents is called instead to get the instant creator of the command get-snapshot.

    Is anyone able to point me in the right direction, or use another method to find the instant creator?

    Thank you.

    $myVMs = get - VM

    $VMsWithSnaps = @)

    {foreach ($vm to $myVMs)

    $vmView = $vm | Get-View

    If ($vmView.snapshot - not $null) {}

    $snapsize = get - vm $vm | Get-snapshot | Select @{N = "SizeMB"; E = {[Math]: tour ($_.)} SizeMb)}}

    $SnapshotEvents = get-VIEvent-body $vm - type info - MaxSamples 1000 | Where {}

    $_. FullFormattedMessage.contains ("Create virtual machine snapshot")}

    try {}

    $user = $SnapshotEvents [0]. Username

    $time = $SnapshotEvents [0]. Createduserid

    } catch {} [System.Exception]

    $user = $SnapshotEvents.UserName

    $time = $SnapshotEvents.CreatedTime

    }

    $VMInfo = "" | Select 'VM', 'CreationDate', 'User', 'SizeMb.

    $VMInfo. "" VM "= $vm. Name

    $VMInfo. "' CreationDate ' = $time

    $VMInfo. "" User "= $user

    $VMInfo. "" SizeMb ' = $snapsize. SizeMb

    $VMsWithSnaps += $VMInfo

    }

    }

    $VMsWithSnaps | Sort CreationDate | FT-auto

    After searching around on google, original screenplay seems to be:

    Find photos of the virtual machine with PowerCLI | A Sysadmin notes

    I've written a script before, which I'll post an article from below, makes you need TO get the name of the creator instant it involves using the API to get the saved task when the snapshot was created, (all times by obtaining the snapshot task of creating for the relevant VM within 5 seconds of the snapshot).  The script to see this section in context here is http://davotronic5000.co.uk/blog/updated-script-to-monitor-snapshots-in-vsphere/.  The part that gets the creators of snapshot is called:

    Write-Verbose"Getting list of Old Snapshots"

       $OldSnapshotList= $SnapshotList | Where {$_.Created-LE(Get-Date).AddDays(-$AlertOlderThan)}

       IF($OldSnapshotList-ne$null)

           {

           Write-Verbose"Getting Additional Snapshot Details"

           #Open report array

           $Report= @()

           $SnapUser= ""

           FOREACH ($Snapshot in $OldSnapshotList)

               {

               #Use Task log SDK to get the user who created the Snapshot

               $TaskMgr = Get-View TaskManager

               $TaskNumber = 100

               #Create task filter for search

               $Filter = New-Object VMware.Vim.TaskFilterSpec

               $Filter.Time = New-Object VMware.Vim.TaskFilterSpecByTime

               $Filter.Time.beginTime = ((($Snapshot.Created).AddSeconds(-5)).ToUniversalTime())

               $Filter.Time.timeType = "startedTime"

               $Filter.Time.EndTime = ((($Snapshot.Created).AddSeconds(5)).ToUniversalTime())

               $Filter.State = "success"

               $Filter.Entity = New-Object VMware.Vim.TaskFilterSpecByEntity

               $Filter.Entity.recursion = "self"

               $Filter.Entity.entity = (Get-Vm -Name $Snapshot.VM.Name).Extensiondata.MoRef

               $TaskCollector = Get-View ($TaskMgr.CreateCollectorForTasks($Filter))

               $TaskCollector.RewindCollector | Out-Null

               $Tasks = $TaskCollector.ReadNextTasks($TaskNumber)

                   #Get only the task for the snapshot in question and out put the username of the snapshot creator

                   FOREACH ($Task in $Tasks)

                       {

                       $GuestName = $Snapshot.VM

                       $Task = $Task | where {$_.DescriptionId -eq "VirtualMachine.createSnapshot" -and $_.State -eq "success" -and $_.EntityName -eq $GuestName}                         

                       IF ($Task -ne $null)

                           {

                           $SnapUser = $Task

                           }

                       $TaskCollector.ReadNextTasks($TaskNumber)

                       }

                   #Create a custom object for reporting

                   $objReport = New-Object System.Object

                   $objReport | Add-Member -Type NoteProperty -Name "Name" -Value $Snapshot.Name

                   $objReport | Add-Member -Type NoteProperty -Name "Description" -Value $Snapshot.Description                

                   $objReport | Add-Member -Type NoteProperty -Name "Created By" -Value $SnapUser.Reason.Username

                   $objReport | Add-Member -Type NoteProperty -Name "Attached To" -Value $Snapshot.VM

                   $objReport | Add-Member -Type NoteProperty -Name "Created On" -Value $Snapshot.Created

                   $Report += $objReport

               #There is a default limit of 32 collector objects, destroying collector after use

               $TaskCollector.DestroyCollector()

               }

  • PS snapshot script... Need help with report

    I am trying to achieve when products are deployed on virtual machines, the instant Powershell script will execute and take snapshots, provide the report as html (output) and then run another Script that will be run against VI3 to commit all snapshots.

    I need assistance with the statement, I want to report to display the VM name + instant summary details, script below shows only instant summary.  Also if there is a script to commit all the snapshots on defined VM.

    **********************************************

    1. Variables

    $VCServerName = "VIServer.

    $CustomFieldName = 'Snapshots'

    $ManagedObjectType = "VMName".

    $today = (get-Date-Format ' YYYY-MM - dd_HH.mm.ss - tt')

    $nsn = "PowerShell-$today.

    $a = ""

    1. Script

    SE connect-VIServer $VCServerName - Port 443 - HTTPS protocol

    Get - VM $ManagedObjectType | New-Snapshot - name $nsn - Description "Instant product update"

    Get-Snapshot $ManagedObjectType | SELECT name, ID, Description, VM creation. ConvertTo-HTML-head $a | Out-file C:\Report.htm

    Invoke-Expression C:\Report.htm

    Disconnect-VIServer $VCServerName - confirm: $False

    You must select the last one.

    Something like this for example

    Get-Snapshot -VM $vm | Sort Created | Select -Last 1 | Remove-Snapshot -Confirm:$false
    

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Path missing iTunes Songs (already tried script)

    Hello

    recently I moved all of my itunes library to my new computer (Mac-> Windows), I noticed that some songs bad location path, and I discovered that the songs with special characters (like aeioun, Yes, I'm Spanish) are those who have suffered from this problem.

    ITunes can't find the songs automatically, said that almost the 2000 song are not and nothing else.

    I'm used to manage xml and looked up in the itunes library xml file and to know that these songs with special characters did not alter his path to the new properly, they keep the way old-macintosh, something like "http://localhost \volumes\macintosh\music\blablabla\".

    The thing is, I tried out solved with samsoft script, but the suggested path does not match my only current. I saw this script search paths similar to what itunes automatically creates, but in my case, I made my own path model (something like \music\%artist%\%artist%-%year%-%album%\%artist% - track - %title%).

    In my xml library I set paths, but when I tried to rebuild the itl file, missing tons of songs and I got crazy once more.

    Is it possible to code in hard itl file to replace this wrong paths? It's just replace 'file://localhost/volumes/macintosh/Music' ' file://localhost/D: / Music»

    I think about modifying the script samsoft to correspond with my custom path, but I am a junior Javascript coder, and I have no idea how this VBS script works.

    Thank you!

    Turingtet2 article may help:

    Empty/corrupted library iTunes after upgrade/crash

  • Image on both monitors synchronization script

    So I have two monitors and several dual screen wallpapers I want to be able to scroll. I have an Applescript script that I got from these forums that someone wrote for this purpose, but I get an error that I can't solve everything. The idea is that the script searches a folder, grabs a random image in this folder file name and seeks the same file name in a second file (a single folder is for the left screen and the other is for the right monitor). It is presents the office as well as the file in the folder 'RIGHT', and then he put the second office with the same file name in the folder "LEFT". This is the script:

    Repeat

    say application 'Finder '.

    game of this_folder to ' Mac Pro: data users: me: photos: desktop computers: _12South:LEFT:

    put raddbdir to the of some file in folder this_folder name

    the value Left_Image to {"" data: Mac Pro users: me: photos: desktop computers: _12South:LEFT: "& raddbdir &" ' "}

    the value Right_Image to {"" data: Mac Pro users: me: photos: desktop computers: _12South:RIGHT: "& raddbdir &" ' "}

    the value image of the desktop to Right_Image as alias

    say application "System events".

    the value theDesktops to a reference in each Office

    set photo of point 2 of the theDesktops in a file Left_Image

    end say

    end say

    delay of 900

    end Repeat

    The paths are 100% correct, so I'm not concerned about it. I get the script error is:

    Events system was an error: can't do integer {"Mac Pro Data: Users: me: Pictures:Desktops:_12South:LEFT:8.jpeg '}.

    And he highlighted this line in the script:

    set photo of point 2 of the theDesktops in a file Left_Image

    It is striking not properly file names. It correctly sets even the image of the main office. "It looks like it runs into trouble when he tries to set the second monitor (left)). Any ideas?

    I think you should just put it as an alias on the end of the line image of the second monitor.

    (I don't know why you have braces around the assignment of image variables.  You're not dealing with lists, you do not have need of them.)

  • Help! Need a script to automatically open files with the same name but in another location.

    Good morning friends,

    So for my work, I need a script to open files with the same name but located in a different folder. But since I'm a total noob when it comes to programming, I can't understand how do. That's what I have in mind:

    -J' I manually open an image.

    -The script will look for a file with the same name in another folder that I've specified.

    -The script will then select the channel CMYK of the second file and copy and paste it into the first file.

    -The second file is then closed without saving the changes.

    I have problems with the part where the script searches for a file with the same name as the opened file. I would really appreciate help. Thanks in advance.

    If (app.documents.length > 0) {}

    myDocument var = app.activeDocument;

    var Nomdoc = myDocument.name;

    try {var basename = docName.match (/(.*)-.)} [ ^\.] +$/)[1]}

    catch (e) {var basename = thedoc.name};

    var path = / * path of folder to insert as a string here * / + ' / ' + base name + / * insert file extension, including the period as a string here * /;

    If (queue (path) .exists == true) {var otherDocument = app.open (File (path))};

    };

  • Need help in obtaining snapshot and decision after... Help please!

    I would like to know if a virtual machine has a snapshot... If so, I need the workflow to terminate and send by e-mail. If it does not have a snapshot, then she can continue with the workflow. I have everything works except the part of the decision, in this case, it will say there is a snapshot when it does not actually exist and complete the workflow... workflow and the script is described below. Any help is very appreciated!

    Get the snapshot Script:

    Snapshot = new Array();

    machines virtual var = VcPlugin.getAllVirtualMachines ();

    for {(i SMV)

    var vm = vms [i];

    If (vm.runtime.connectionState.value == "connected" & &! vm.config.template) {}

    var vmLayout = vm.layoutEx;

    {if(vmLayout!=null)}

    var layoutFiles = vmLayout.file;

    var layoutSnapshots = vmLayout.snapshot;

    for {(l layoutSnapshots)

    var layoutSnapshot = layoutSnapshots [l];

    dataKey var = layoutSnapshot.dataKey;

    for {(layoutFiles m)

    {if (layoutFiles [m]. Key is dataKey)}

    If (layoutFiles [m] .size/1024/1024 > snapshotSize) {}

    capture instant var = VcPlugin.convertToVimManagedObject (vm, layoutSnapshot.key);

    Snapshot.push (snapshot);

    System.log ("Name:" + layoutFiles [m] .name + "-size:" + layoutFiles [m] .size);

    }

    }

    }

    }

    }

    }

    }

    Decision of snapshot:

    If (snapshot. Length > 0) {}

    Returns false;

    } else {}

    Returns true;

    }

    Yes, it is possible.

    Perhaps the easiest way is to define an attribute (of type VC:Datastore) workflow, select its value using the selector and then use it in your work flow the same way you used the input parameter.

    Another option would be to "Default Value" production designer in the presentation for the input parameter data store and bind it to a script action that returns the value of desired data store object.

  • Snapshot location has changed - still no work

    Hello

    Yesterday, I tried to create a snapshot for a machine that has the disc:

    -Disk 1 = > 190 GB on a local storage (block size of ~ 815 GB / 1 MB)

    -Disk 2 = > 2 TB on a storage iSCSI (block size of 2 to/8 MB)

    Due to the size of the "disk 2" I couldn't do a snapshot in the default location, which is the directory of the virtual machine on the "disk 1". Get the message "the file is larger than the maximum size supported by the data store".

    So, after searching a little I found the article to change the location of the snapshot. Search store snapshots on a third drive:

    -Disc 3 = > 4 to on iSCSI storage (4 TB (2 x 2 to/8 MB block size) ~3.6 to are free)

    Add these two lines at the end of the vmx file:

    workingDir = "" / vmfs/volumes/Disk_3/VM-Snapshots ' "

    Disk_1 /machineXY Sched.swap.dir="/vmfs/volumes/.

    The virtual machine removed from the inventory and readded, but I still get the same error message when you try to create a snapshot.

    When you change the settings of the machine, I see that the "VM workplace" is set to the new location. The configuration file is still on the repertoire of the virtual machine on 'Disc 1'.

    The Machine runs VMware ESXi 4.0.0 build 236512.

    Any ideas why it still doesn't work?

    Thank you

    URS

    Ahhh... OK, so if I understand correctly, the second disc should be (at least) 16 GB smaller to make snapshots to work?

    Fix.

    Even if the place to store catches instant itself is larger than 2 TB, because a single vmdk cannot 2 TB and more, right?

    Yes. The snapshot file contains additional data for management. In this way a "full" snapshot file can be a few GB of more big than the basic disk and the maximum size of a file is always 2 TB-512Bytes.

    Store the file on disk 3 makes no difference.

    It is simply designed as a test, if the above does not apply.

    André

  • Host search for any virtual machine is slow.

    Community

    I want to improve performance on the following code. Takes more than 2 hours to run. I think that the reason for which its so slow is due to Get - VM. Once, I saw a Get - view on how to improve the performance of Get - VM but don't know exactly how to use it. The script search the whole army to the virtual Center and produces a list of host with no virtual machine. I'd like to remove the flags of CPU as each host returned so I can match as processors if possible.

    Thank you

    $vcs = @)

    $vcs += viserver-connect server01

    $vcs += viserver connect server02

    $vcs += viserver connect server03

    $vcs += viserver connect server04

    $allhost = Get-VMHost -Server $vcs

    {foreach ($virtualhost in $allhost)

    If (-not (get-vmhost -Server $vcs $virtualhost |)) Get-VM {( -Serveur $vcs)) {echo "$virtualhost"}}

    Disconnect-VIServer -confirm: $false

    You have more than 1 Virtual Center in your environment?

    If so, you can provide them at the same time as input to the cmdlet Connect-VIServer tabular.

    With the following code, you should be able to list all the ESX servers that have no guests set on them as well as CPU masks for each ESX Server.

    $vcs = Connect-VIServer -Server ,,...,
    
    $allhost = Get-View -ViewType HostSystem -Server $vcs
    foreach($virtualhost in $allhost){
         Write-Host $virtualhost.Name
         if($virtualhost.vm.count -eq 0){
              Write-Host "==> No guest defined" -foregroundcolor red
         }
         foreach($cpuInfo in $virtualhost.Hardware.CpuFeature){
              Write-Host "CPU Level" ("{0:x}" -f $cpuInfo.Level)
              Write-Host "`tEax:" $cpuInfo.Eax
              Write-Host "`tEbx:" $cpuInfo.Ebx
              Write-Host "`tEcx:" $cpuInfo.Ecx
              Write-Host "`tEdx:" $cpuInfo.Edx
         }
    }
    
  • How to limit a GREP search to the selected text

    Hello

    I have a script GREP seeking gaps in a series of endnote numbers. This helps a corrector to know quickly if a number was inadvertently left out.

    However, in a document number series can be repeated because the document contains more than one chapter.

    So I guess I could write the script search for a series of numbers in the selected text, i.e. an entire chapter. But, looking at the properties for findGrepPreferences I don't see all this limits the search to a selection. However, the GREP dialog box allows a search of Documents, Document, history, to end of history and the selection.

    Where can I find these properties?

    Tom

    You perform a loop on theRange:

    finds=[];
    for(i=0;i
    

    I'll just write all...

    This should work (untested):

    var myDoc = app.activeDocument;
    var firstPage = 2;
    var lastPage = 4;
    var myRange = [];
    for(var i=firstPage;i
    

    Substances

  • Looking for examples of customized with folder KD with paged results search

    Hello

    I'm looking into writing a portlet that is customized for the search for one or more specified folders of knowledge (Community preferences) directory and display the results, "inline", in a table with pagination. This seems to be a fairly common thing to want to do; and snapshot of search doesn't have the ability to customize the results of how I would like to display.

    It would be fantastic if someone has a code that they were willing to share who does that canned; but I'm really looking for a good example to get results of research via the API (.net) and link these results to a grid to display.

    Any help is appreciated.

    -tomS.

    Hey Tom, shoot me an email and I can send you our code for this canned as well as screenshots and explanations of how it works.
    And Yes, its to .NET and works very well in 6.0 - 6.1mp1, have not yet tested in 6.5.

    [email protected]

  • Suggestion of extension

    Please make an extension that forces #YouTube to display the menu of the left sidebar even when play videos.

    Could someone create a userscript to activate the button in the top left (< id button = 'bar access-guide-button' >). A user script is a slight code piece that you apply to the sites using the Greasemonkey extension. To request a script be written or to check if it already exists, try these sites:

    Note: As with any add-on, exercise caution in the choice of the user scripts because they have significant access to your browser.

  • Using Automator to app to create. ISO

    Hello

    I have an Applescript that is very useful for the use of ffmpeg to convert video files.  Of course, in this script is a Terminal script to actually run ffmpeg.

    It looks like this:

    the term {parameters}

    Tell application "Terminal".

    activate

    filesString the value «»

    Repeat with file_ in entry

    the value filesString filesString & "" & quoted (file_ POSIX path)

    end repeat

    do script "for f in" & filesString & ";" do. "

    / Users/Mike/Documents/Scripts/ffmpeg - i \"$f\" - acodec pcm_s16le - vcodec v210-level 1 - Encoder 1 - context 1 - qscale 1 g - 0 ${f%.*}.mov.

    tell the end

    Back entrance

    end of race

    It works really well for just a file on the app and do run.  But now I want to create ISO from DVD images that I created in the past.  The above script searches the path of entry and in the output path of the new file with the same name.  I want to do a couple different things.

    First of all, I cannot of course back the new file on the DVD but I don't know how to change the script correctly, but I've highlighted where I think we should probably change. In addition, I want a prompt the user to choose a destination.  I was really close with:

    "myPath choose the folder with the value prompt" choose a folder:

    It would be nice to both the value of the path and the name of the file at that time.

    I also like that I can see the status of the creation of the ISO in the Terminal.

    I take a very basic course to learn Applescript, but I'm still not there. Help please?

    I have a few comments...

    There is nothing inherently wrong with your script - it is essentially collecting all the data, and then firing a shell single command to do the job. The problem is that to extend the functionality to create a .iso, you must do this within the shell command.

    An alternative (more easy - at least for an experienced AppleScripter) way would be to reduce to a minimum the shell command to the bare (i.e. treat as an individual file) and use AppleScript to manage the closure and variable. For example, rather than build a chain of files and passing to a shell command that iterates over it, I'd do something more like:

    say application "Terminal."

    activate

    Repeat with file_ in entry

    filesString game to quoted form of (path of file_ POSIX)

    script "/ Users/Mike/Documents/Scripts/ffmpeg - i" & fileString & "- acodec pcm_s16le - vcodec v210-level 1 - Encoder 1 - context 1 - g 1 - qscale 0"& fileString & ".mov".

    end Repeat

    end say


    You have now each specific file in an AppleScript variable (file_), which is passed to a shell command that executes your order. Several input files only invoke the command shell several times. This makes it much easier to add treatment by folder

    Regarding the other issue - selecting the location/name of output file, simply replace your folder "Choose" with "Choose file name." This will allow the user to specify a file name and a directory using the standard user interface, from which you can extract the data you want:

    Repeat with file_ in entry

    -This establishes name of input file:

    say application "System events".

    put nomfichierentree to the name (obtain the properties of file_)

    end say

    -prompt the user for where this file should be saved

    outputFile to choose the file name prompt "specify output file name for" & nomfichierentree

    inputFilePath game to quoted form of (path of file_ POSIX)

    outputFilePath game to quoted form of (POSIX path of outputFile)

    say application "Terminal."

    activate

    script "/ Users/Mike/Documents/Scripts/ffmpeg - i" & inputFilePath & "- acodec pcm_s16le - vcodec v210-level 1 - Encoder 1 - context 1 - g 1 - qscale 0"& outputFilePath.

    end say

    end Repeat


    Also note that I've separated the code in more sense (to me, at least) pieces... I have separate application logic regarding input and output files and target just Terminal.app with the specific commands that relate to it.


    From there, you can easily integrate additional orders to "do script" to do what you want, using the same variables to map the input and output file names.

  • Issues export and APEX

    Hello!

    I m affected by some problems, listed below:

    1, export with caution:

    EXP-00084: unexpected DbmsJava error-4043 in step 6661

    EXP-00008: ORACLE error 4043

    ORA-04043: object does not exist

    EXP-00000: export completed unsuccessfully

    2nd, APEX with a valid, but client-side state is functioning normally.

    COMP_NAME STATUS

    ---------------------------------------- -----------

    Oracle Application Express INVALID

    Oracle Enterprise Manager VALIDATES

    Oracle database XML VALID

    Oracle Text VALID

    VALID Oracle Expression filter

    Rules of Oracle Manager VALID

    Oracle Workspace Manager VALIDATES

    Oracle Data Mining VALID

    Oracle INVALID database catalog views

    Packages of Oracle and VALID Types database

    JServer VALID JAVA virtual machine

    Oracle XDK VALID

    VALID packages of Java in Oracle database

    Anyone has an idea about this?

    Maybe you can get some clues if you run the "apexvalidate.sql" script that is located in the folder main 'apex '.

    So before you start the procedure "validate_apex" which was created by the script, search and replace all occurrences of the string "^ 3" with "APEX_040200" (assuming that it is the version of the Apex being installed). "

    Compile the procedure set serveroutput on, then run it as SYS.

    You will get a list like this:

    anonymous block filled

    ... Database user "SYS", "APEX_040200", the user database schema # '61' 15:26:48

    .. . Compiled on 3008 considered objects 0, 0 doesn't have a compilation 15:26:48

    ... 268 packages

    ... 260 package body

    ... 452 tables

    ... 11 functions

    ... 16 procedures

    ... 3 sequences

    ... 457 triggers

    ... index of 1320

    ... 211 views

    ... libraries 0

    ... 6 types

    ... organizations of type 0

    ... operators 0

    ... types of index 0

    ... Start the object key existence check 15:26:48

    .. . Completed object existence check 15:26:49 key

    ... Definition DBMS register 15:26:49

    ... Registry DBMS implementation complete 15:26:49

    ... Output of validate at 15:26:49

    May be you will get significant mistakes instead, in my case everything was ok.

    Flavio

    ----

    http://oraclequirks.blogspot.com

  • Find the words (wild cards) using regular expressions

    I'm testing to see if the words are present for revision 1 of a drawing of the cartridge.

    The script search the digit 1 followed by a date, a title, and 4 sets of initials.

    The number 1 is static, (date, title and original are the cards that they are different for each design).

    I use regular expressions to match the words.

    The regular expression highlighted in blue is the number 1 and the date.

    Him remains highlighted in orange does not match the title and initials.

    If anyone can help with the regular expression that is most appreciated.

    Once I got that work will add the form fields for the initials, noting only the console at this point for the tests.

    numWords = this.getPageNumWords (0);

    number of words on the page

    loop through the words on the page

    for (var j = 0; j < numWords-1; j ++)

    {/ / get the pair of words to test}

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (0, j + 1); test words

    Check if 1 26.05.16 THE STRENGTHENING REVISED MM SB AE GM word string is present

    If (ckWords.match(/ ^ 1\s [0-9] {1,2}.)) [0-9] {1,2}. [0-9] {2} \s\w+(\s+\w+){1,7}/))

    {

    Console.println (ckWords);

    }

    }

    You can use something like this:

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (j, 0, + 1) + ' ' + this.getPageNthWord (0, + 2 j) + ' ' + this.getPageNthWord (0, j + 3) + ' ' + this.getPageNthWord (0, j + 4) + ' ' + this.getPageNthWord (0, j + 5) + ' ' + this.getPageNthWord (0, j + 6);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 7);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 8);

    If (ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} {2} \s\w+ \.\d (?:-s + \w +) 1.8 ([A - Z] {2}) \s([A-Z]{2})\s([A-Z]{2})\s {} \s([A-Z]{2})$ /))

    {

    ...

Maybe you are looking for

  • What is in 25.0.1?

    Received a prompt (for lack of a better word...) this morning about 25.0.1 is available - but the link that was supposed to describe "what is in it," doesn't work. I can't download the new versions just because someone told me to. What are the defect

  • Satellite L350 - CD/DVD drive does not open

    I have a new laptop, less than a month, but his habit of CD/DVD tray open by pressing eject button. Eject-do a right-click on its icon does not open it no more. There is no disc inside, it is visible in the BIOS, no sign of a driver problem in Device

  • access to the bios win 8

    I just got my new lenovo G480, 4 GB RAM, 1 TB of HARD drive laptop GT635M VGA 2 GB pre-installed with windows 8. When I start my laptop, I don see an option for me access bios as previously in win7 we see press F2 to enter the BIOS on the bottom left

  • End Menu Parent program?

    Hello Just got this weird error last night on an old computer. I woke the computer from sleep and proceeded to use Microsoft Word. Word kept gel and had to be force closed. Then all of a sudden the PC just froze. I tried disconnecting and stopping bu

  • Windows Media Player - file duplicates

    Windows Media Player files duplicates, how to tell him not to duplicate and same files play list?  Downloaded Albums sometimes appear with two of each song. Sometimes originally, sometimes after I played the album. Sometimes after playback of a playl