Select-String group

I am trying to read a text file with Powershell than use select-string.
When I do this:
Statement Date: 04/12/15" | Select-String -Pattern "Statement Date: (?<digit>\d{2}[/]\d{2}[/]\d{2})" | select -Expand Matches | foreach {$_.groups["digit"].value} - it works fine. I get the value "04/12/15"
This is what I have:
gc -Path $file | Select-String -Pattern "Statement Date: (?<digit>\d{2}[/]\d{2}[/]\d{2})" | select -Expand Matches | foreach {$_.groups["digit"].value} - I get nothing
Thanks for your help
Freddy91761_1

I think we need more info about what in the $file because above example seems to work if the file contains only "Statement Date: 04/12/15"
PS:> set-content C:\temp\testfile "Statement Date: 04/12/15"PS:> gc C:\temp\testfileStatementDate: 04/12/15PS:> gc C:\temp\testfile  | Select-String -Pattern "Statement Date: (?<digit>\d{2}[/]\d{2}[/]\d{2})" | select -Expand Matches | foreach {$_.groups["digit"].value}04/12/15

Similar Messages

  • Partition Name in Select and Group-By

    Is there a function that returns the partition name a row is stored in? I'd like to use it in a SELECT statement, if it exists.
    The goal is to get row counts per partition to determine skew on a hash-based partition (otherwise, I'd just select and group-by the partition key). I want to do something like this:
    SELECT PARTITION_NAME, COUNT(*) as PER_PART_COUNT
      FROM SOMETABLE
    GROUP BY PARTITION_NAME;Obviously, I would replace the string "*PARTITION_NAME*" with whatever function returns that value.
    NOTE: Before the forum sharks jump all over me, I did search the documentation and forums, but I came up empty handed.

    Hi,
    This is hokey - but you can use the undocumented function "tbl$or$idx$part$num" like so:
    SELECT   atp.partition_name
           , COUNT (*) AS count_rows
        FROM all_tab_partitions atp
           , (SELECT tbl$or$idx$part$num ("SCOTT"."TAB1"
                                        , 0
                                        , 1
                                        , 0
                                        , partition_col1 -- your 1st partition key column
                                        , partition_col2 -- your 2nd partition key column
                                         ) AS part_num
                   , 'TAB1' AS table_name
                   , 'SCOTT' AS owner
                FROM scott.tab1) pt
       WHERE atp.table_name = pt.table_name
         AND atp.table_owner = pt.owner
         AND atp.partition_position = pt.part_num
    GROUP BY atp.partition_name;Note - this probably won't perform well at all... but it could be an option...
    Message was edited by:
    PDaddy
    ... On 2nd thought - don't do it - it seems it is pretty unstable - brought my session to a halt a couple of times... Forget I mentioned it :)
    ... On 3rd thought - if you add ROWNUM - it works fine - seems you need to materialize the result set in the inner query - like so:
    CREATE TABLE part_tab (part_key int
                         , a int
    partition by range (part_key)
    (partition p1 values less than (100)
    ,partition p2 values less than (200)
    ,partition p3 values less than (maxvalue)
    insert into part_tab
    select rownum
         , rownum
    FROM all_objects
    where rownum <= 1000; SELECT atp.partition_name
         , COUNT(*) AS count_rows
    FROM all_tab_partitions atp
       , (SELECT TBL$OR$IDX$PART$NUM("PART_TAB", 0, 1, 0, part_key) AS part_num
               , 'PART_TAB' AS table_name
               , user AS owner
               , ROWNUM AS rn -- Materialize the result set by adding ROWNUM...
          FROM part_tab) pt
    WHERE atp.table_name = pt.table_name
      AND atp.table_owner = pt.owner
      AND atp.partition_position = pt.part_num
    GROUP BY atp.partition_name;

  • Alternative to find unique records with 60 character in selection string.

    Hi,
    We have to find out the values from the Infoobject. When we try to display data from an master object, the maximum length of selection it accepts 45 characters only but we need to input data around 60 characters in selection.
    Thing we tried:
    1. Selecting complete data without any condition but it did not work due to large volume of data.
    2. We tried to extract data from RSA3 but it did not work due to large volume of data.
    Please suggest me alternative to find unique records with 60 character in selection string.
    Regards,
    Himanshu Panchal.

    This sounds a bit strange. Are you perhaps mistakenly storing text data incorrectly as the primary key of the master data? I can't think of any actual data that is that length to ensure usinqueness - even GUIDs are maximum 32 characters - but GUIDs don't count as actual "readable" data although you do need to be able to select it from time to time. Perhaps you have a super secure password hash or something like it ?
    Also are you expecting to have a unique single record returned by your selection? To do this would in general REQUIRE that ALL the data is read because master data is not stored in the DB sorted by the data itself, but stored instead sorted by the it's SID.
    When you say you are selecting data from master data, which master data tables are you using? I have been able to select data from very large MD table (15 million unique records) using SE16 with no problems. Just enter the table name, and before you execute just count the number of records - it helps to know what you want to end up with.
    Have you tried using wild cards (the *) to preselect a smaller number of records : * a bit of your 60 character string *
    If you are trying to select from a non-key field you will encounter performance issues, but you can still use the wildcards, and get a result.
    Don't use RSA3 it was designed to make selections and group them into datapackets. It's not the same as selecting directly on the table in SE11 or SE16

  • Usage Based Optimization Wizard not finding Queries for Selected Measure Group (2008)

    I have configured my analysis services server to capture queries in an OLAP Query Log table. The connection string points to a table on a SQL Server relational database.  I have verified that the dbo.OlapQueryLog table was created. I have set it to
    capture every 5th query.  The table has been collecting query statistics for several hours. I opened my model in BIDS, clicked on the cube and opened the Aggregations tab.  I click on the measure group partition and select the Usage Based Optimization
    button. The wizard opens up and I click next.  In the "Specify Query Criteria" dialog, there is a warning that there "are no queries in the log for the selected measure group".  The problem is that there are queries but the UBO
    Wizard doesn't seem to be finding them.  Do I need to set a property in the BIDS to point to the location of the query log file in the relational database?
    davidg12

    Hi David,
    Is your SSAS database name and ID are same? We came across same kind of issue while ago. We initially created our database with one name and later renamed the database.
    The database name and ID should be same in order to perform Usage Based Optimization.
    To do so,
    On the solution explorer the top node is the database.
    Right click on that node and click edit database. In the property windown you should be able to see ID. The ID and the name of the database should be the same. 
    If both are not same, Change the database name to match ID.
    Please mark as Answer if this helps!
    Rajasekhar.

  • Syncing to selected contact group wants to delete files outside of it

    Hello -
    I am trying to sync my iPhone contacts to my address book in a specific way. In my address book, I have my personal contacts - friends and family. I also have mailing list subscribers (which gets into the 1,000s - people with whom I am not personally connected). I copied all of my personal contacts into a separate group and selected that group under the iPhone sync options in iTunes. I also checked the box marked "add contacts created outside of groups in this iPhone to" and again chose the special "personal contacts only" group.
    However, when I go to actually sync, I get a pop-up box saying that so many contacts will be added (to my laptop), so many contacts will be modified, and so many contacts will be deleted. Which ones are getting deleted? All the ones that are not on my phone, so basically all of my mailing list, non-personal contacts.
    Isn't the point of syncing specific contact groups so that you can have your phone dialogue with that particular folder and nothing else - leaving anything outside of that folder alone?
    Just to test it out though, I changed the sync setting to "all contacts" to see what would happen, and I get the same message (it's basically going to delete anything that's on my laptop, but not currently on my phone). Why does this happen? Isn't the whole idea of synchronization that the two devices end up having the same file lists? How can I get the iPhone to populate any contacts I added on it to a specific group on my laptop, and vice versa. Seems like they should populate each others lists with missing pieces, rather than one taking the other one over and deleting, well, anything (unless I tell it to).
    And no, I do not have any of the advanced overwrite functions enabled.
    Does anybody have a solution to this problem? I'd like to sync my contacts, but obviously don't need 2,000 names of people I don't personally know taking up space on my phone.
    Thanks for any advice you all can provide!

    I think MobileMe is all or nothing--I asked a chat agent a few months back, and that was the case, haven't seen any reports or UI changes.
    Send them feedback--it would be great to select Groups and Calendars.
    http://www.apple.com/feedback/mobileme.html

  • How to select a group of icons in a folder?

    This may seem dumb, but I'm a new Mac (OS X) user. In windows I used to be able to shift-click a group of adjacent icons within a folder to select them, in order to copy them etc. On my Mac, I can only seem to do this in list or column view, and as a visually orientated person, I don't find this helpful - I want to see the icons I'm selecting. How do I do this?
    Thanks,

    From the Help menu 'selecting items':
    +Click to select a single item. Drag to select a group of items.+
    +Press the Shift key and click other items to include them in the selection. Click a selected item to deselect it.+
    +To select multiple items in a list that are not next to one another, press the Command key and click the items you want. Click a selected item again to deselect it.+

  • GRC CUP - How to add a custom field in "Select Roles/Groups" form

    Hi Forum,
    I created a custom field "REGION" in CUP configuration. I used this field in "Role Attributes"
    In "New Account" workflow, when i click on Select Roles/Groups" a screen for Select Roles/Groups will display to select the roles by different combinations.
    I need this "REGION" field in the above selection creria to select roles by REGION.
    How to make this field "REGION" appear in above selet cretiria.
    Thanks,
    RAM
    Edited by: Ram.Sathish on Apr 21, 2011 3:46 PM

    you can not add custom fields in the search, have you thought about using the company field as the fied for location?
    Regards,
    Chinmaya

  • Free PO indicator in field selection key/group

    Hi all,
    I would like to make Free PO indicator as mandatory field in PO thru specific document type field selection reference key. When I search for the field, it is not available for existing field selection key (Field selection group).
    How can I add the Free PO indicator into this field selection key/group or Does it represented in different name.
    Kindly clarify.
    With regards
    Suddy

    Hi,
    "Free Indicator" doesn't exist in field selection. If you wanto to have Free Indicator ON for a specific PO Document Type then you need to do ABAP Development for this.
    Use BAdi --> ME_PROCESS_PO_CUST
    Interface --> PROCESS_ITEM (Processing of Item Data)
    Below is the Sample Code for your reference;
    If w_bsart EQ 'ZPOD'.
        wa_item3-repos = ' '.
      ELSE.
      ENDIF.

  • Help!  I recently upgraded to OS 10.9.4 from 10.6.8, and now when I want to send an email to a group in my contacts I am no longer able to select the group as a whole.  I have to select each address individually.  This can't be right.

    Help!  I recently upgraded to OS 10.9.4 from 10.6.8, and now when I want to send an email to a group in my contacts I am no longer able to select the group as a whole.  I have to select each address individually.  This can't be right.  With 10.6.8 I used to be able to double click on the name of the group and they would all be selected.  I've also noticed that my address book is now called "contacts."  Thanks in advance for your help.

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the
         computer and after the chime press and hold down the OPTION key until the boot manager
         screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.4 update: OS X Mavericks 10.9.4 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
         Reinstall the 10.9.4 update: OS X Mavericks 10.9.4 Update (Combo).

  • Mavericks Mail-cannot scroll down to select a group by holding mouse button.

    I do not like the new Mavericks mail. When I attempt to hold the left mouse button and scroll down to select a group, the program automatically locks onto the first message I touch and moves it. Prior to Mavericks scrolling was an easy process. This new mail is very clumsy and I have to select one message, then hold shift key, then selelct the last message in the group. ....Clumsy and slow.
    Does anyone know a workaround for this? The tutorials don't address it and the "What's new in Mail?" file doesn't either.  If there is not a workaround, is there a way to disable the Mavericks configuration in Mail and go back to regular mail? I'd appreciate any tips or help on  this.

    Okay, I tried deleting the Finder preferences first (along with a handful of other preference files that I knew were no longer needed), and it seemed to help--at first. But eventually, all the same problems started happening again, so I concluded that it was necessary to just start with a fresh (empty) preferences folder. As you know, this is a pain to deal with, but I limited my pain by moving all the old preferences files into a folder on the Desktop rather than simply deleting them. That way, I could just put back any missing preferences that were too hard to recreate. Restoring all of my preferences with new (uncorrupted) prefs files will be an ongoing process, but the good news is that this effort (so far) seems to have solved the problem. Mail is responding to all my clicks, even when I switch between different apps and different spaces.  :-)
    Now that things are working correctly, I notice that when I switch between apps and/or spaces, the selected app (or the frontmost app in the new space) will show an active state for its window, whereas before, the selected app didn't update to show that it was active--it kept the inactive state for its window. I'm no expert, but it seems to me that this might have something to do with the windowserver process, so it might make sense for the next person who stumbles on this thread to start by deleting any preferences files that begin with com.apple.windowserver. Just a hunch, but it's worth starting there before you do a complete flush of all your preferences.
    Thanks again for the help--hopefully this workaround will be persistent. Fingers crossed!

  • Selection String Empty when Refresh Report

    I'm using CR2008 in VS 2008 (WinForms not Web). This seems like a fairly easy thing to do (was in VB6/CR8.5).
    My program provides a list of reports via the FileDialog, grabs the report name, loads the report document with the report, then the viewer displays the report. Everything works great to that point, but then the user refreshes the report and the selection string is changed to "" (empty) and all records from the table are displayed. Is there something that I'm missing here?
    I have tried both 8.5 and CR2008 reports with the same results. The login seems to be working fine.
    Any help would be appreciated,
    Thanks
    RA Smith
    Puzzled
    Code:
    Private Sub OpenCrystalReportDirectoryToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenCrystalReportDirectoryToolStripMenuItem.Click
    If FileIO.FileSystem.DirectoryExists(dirPath) = False Then
    MsgBox("Crystal Reports Directory not valid. " & _
    "Check that drive is mapped to S: drive.", MsgBoxStyle.Exclamation)
    Else
    Me.OpenFileDialog1.InitialDirectory = dirPath
    If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
    Try
    rptName = OpenFileDialog1.FileName
    If FileIO.FileSystem.DirectoryExists(rptName) = True Then
    MsgBox("File not found", MsgBoxStyle.Exclamation)
    Else
    Me.reportDocument1.Load(rptName, OpenReportMethod.OpenReportByTempCopy)
    Me.CrystalReportViewer1.ReportSource = Me.reportDocument1
    End If
    Catch Ex As Exception
    MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
    End Try
    End If
    End If
    End Sub

    Ludek,
    This application does nothing but allow the user to select a report from a shared folder on our company server and display.  The report comes in with the correct selection string but with "old" data.  When the refresh button is pressed from the CR Viewer the selection changes to an empty string, therefore, displaying all records in the database table. 
    The report that I'm currently trying to display has no parameter fields. The selection string in the report is:
           {table.amt} > 0.00 and {table.paid} <> "y"
    So do I need to save this selection string and set it each time the user presses REFRESH?  What happens when I move to a report that has parameters?
    I'm still reading microsoft help for VS2008/CR2008 but haven't found anything yet.  Not to say that I didn't miss a step here or there.  The only other thing that I noticed was a setting on the reportDocument called ReportAppServer which was set to <EMBEDDED_REPORT_ENGINE>.  I have been trying to locate information on this setting but there are no other options on the properties screen.  Could this be part of my problem?  I pulled the reportDocument from the toolbox onto the windows form.
    I did not have a problem with this in the old VB6/CR8.5 viewer that I'll be replacing over the next few months as I move from VB6/CR8.5 to VS2008/CR2008.
    Thanks,
    RA Smith

  • HT3529 How do you send a message to a group of people.  I want to invite our local friends to a birthday party.  I have created a group called "Centerville Gang".  The group has about 12 people in it.  Is there a way I can select this group to receive thi

    I want to invite 12 people to a birthday party.  I have created a group called "Centerville Gang"  I want to send just one message to all of these people.  I would think there would be a way to select this group as the recipients once instead of doing 12 searches through my contacts to get all of the members in the group but I cant seem to figure it out.  I must be missing something.  Can you help?

    Contact groups do not allow for group emailing. they are just an organizational tool for the contacts list.

  • Script select parent group by layer

    I have complicated workflow in photoshop in which i often use selection of layers by ctrl+click (auto-select is unchecked and selecting layers is chosen) That works good for me. But some time i need quickly select parent group of active layer (only one level up) (it can be achived by using some keyboard shortcut)  I think the only way to do that is PS scripting.
    Im new to photoshop scripting but i have a lot of expirience in other languages
    As i understand its sould take just couple commands:
    1) select parent folder from active object (it can be any type of layer)
    2) Collapse this folder (cos it was uncollapsed before)
    what syntax shoud i use for this commands? i tried to use help but couldn't find even how to select parent folder of active layer..
    Any help?

    I've tried the following codes and it works for me. It selects the parent layer of the group and then collapses it:
    1. copy the following script and paste it into notepad. Save it as LayerSetSupport.jsx and save it in the same folder as all your other scripts:
    //START HERE------------------------------------------
    //For code readability
    function cTID(s){return charIDToTypeID(s)}
    function sTID(s){return stringIDToTypeID(s)}
    // =============================
    function openAllLayerSets( parent ){
        for(var setIndex=0;setIndex<parent.layerSets.length;setIndex++){
            app.activeDocument.activeLayer = parent.layerSets[setIndex].layers[0];
            openAllLayerSets( parent.layerSets[setIndex]);
    function closeAllLayerSets(ref) {
              var layers = ref.layers;
              var len = layers.length;
              for ( var i = 0; i < len; i ++) {
                        var layer = layers[i];
                        if (layer.typename == 'LayerSet') {closeGroup(layer); var layer = layers[i]; closeAllLayerSets(layer);};
    function openGroup(layerSet) {
       var m_activeLayer = activeDocument.activeLayer;
       var m_Layer_Dummy01 = layerSet.artLayers.add();
       var m_Layer_Dummy02 = layerSet.artLayers.add();
       layerSet.layers[1].name = layerSet.layers[1].name;
       m_Layer_Dummy01.remove();
       m_Layer_Dummy02.remove();
       activeDocument.activeLayer = m_activeLayer;
    function closeGroup(layerSet) {
       var m_Name = layerSet.name;
       var m_Opacity = layerSet.opacity;
       var m_BlendMode = layerSet.blendMode;
       var m_LinkedLayers = layerSet.linkedLayers;
       var m_bHasMask = hasLayerMask();
       if(m_bHasMask) loadSelectionOfMask();
       if(layerSet.layers.length <= 1) {
          addLayer();
          var m_Tmp = activeDocument.activeLayer;
          m_Tmp.name = "dummy - feel free to remove me";
          activeDocument.activeLayer = layerSet;
          ungroup();
          addToSelection("dummy - feel free to remove me");
          groupSelected(m_Name);
       } else {
          activeDocument.activeLayer = layerSet;
          ungroup();
          groupSelected(m_Name);
       var m_Closed = activeDocument.activeLayer;
       m_Closed.opacity = m_Opacity;
       m_Closed.blendMode = m_BlendMode;
       for(x in m_LinkedLayers) {
          if(m_LinkedLayers[x].typename == "LayerSet")
             activeDocument.activeLayer.link(m_LinkedLayers[x]);
       if(m_bHasMask) maskFromSelection();
       return m_Closed;
    function ungroup() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Lyr " ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( sTID( "ungroupLayersEvent" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function addLayer() {
       var m_ActiveLayer          =    activeDocument.activeLayer;
       var m_NewLayer             =    activeDocument.artLayers.add();
       m_NewLayer.move(m_ActiveLayer, ElementPlacement.PLACEBEFORE);
       return m_NewLayer;
    function hasLayerMask() {
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( sTID( "layer" ), cTID( "Ordn" ), cTID( "Trgt" ));
       var m_Dsc01= executeActionGet( m_Ref01 );
       return m_Dsc01.hasKey(cTID('Usrs'));
    function activateLayerMask() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Chnl" ), cTID( "Msk " ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( cTID( "slct" ), m_Dsc01, DialogModes.NO );
       } catch(e) {
          var m_TmpAlpha = new TemporaryAlpha();
          maskFromSelection();
          activateLayerMask();
          m_TmpAlpha.consume();
    function deleteMask(makeSelection) {
       if(makeSelection) {
          loadSelectionOfMask();
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( cTID( "Dlt " ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function selectLayerMask() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated(cTID("Chnl"), cTID("Chnl"), cTID("Msk "));
       m_Dsc01.putReference(cTID("null"), m_Ref01);
       m_Dsc01.putBoolean(cTID("MkVs"), false );
       try {
          executeAction(cTID("slct"), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function loadSelectionOfMask() {
       selectLayerMask();
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putProperty( cTID( "Chnl" ), cTID( "fsel" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       var m_Ref02 = new ActionReference();
       m_Ref02.putEnumerated( cTID( "Chnl" ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "T   " ), m_Ref02 );
       try {
          executeAction( cTID( "setd" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function maskFromSelection() {
       if(!hasLayerMask()) {
          var m_Dsc01 = new ActionDescriptor();
          m_Dsc01.putClass( cTID( "Nw  " ), cTID( "Chnl" ) );
          var m_Ref01 = new ActionReference();
          m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Chnl" ), cTID( "Msk " ) );
          m_Dsc01.putReference( cTID( "At  " ), m_Ref01 );
          m_Dsc01.putEnumerated( cTID( "Usng" ), cTID( "UsrM" ), cTID( "RvlS" ) );
          try {
             executeAction( cTID( "Mk  " ), m_Dsc01, DialogModes.NO );
          } catch(e) {
             activeDocument.selection.selectAll();
             maskFromSelection();
       } else {
          if(confirm("Delete existing mask?", true, "Warning")) {
             activateLayerMask();
             deleteMask();
    function groupSelected(name) {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putClass( sTID( "layerSection" ) );
       m_Dsc01.putReference(  cTID( "null" ), m_Ref01 );
       var m_Ref02 = new ActionReference();
       m_Ref02.putEnumerated( cTID( "Lyr " ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "From" ), m_Ref02 );
       var m_Dsc02 = new ActionDescriptor();
       m_Dsc02.putString( cTID( "Nm  " ), name);
       m_Dsc01.putObject( cTID( "Usng" ), sTID( "layerSection" ), m_Dsc02 );
       executeAction( cTID( "Mk  " ), m_Dsc01, DialogModes.NO );
       return activeDocument.activeLayer;
    function addToSelection(layerName) {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putName( cTID( "Lyr " ), layerName );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       m_Dsc01.putEnumerated( sTID( "selectionModifier" ), sTID( "selectionModifierType" ), sTID( "addToSelection" ) );
       m_Dsc01.putBoolean( cTID( "MkVs" ), false );
       try {
          executeAction( cTID( "slct" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function TemporaryAlpha() {
       activeDocument.selection.store((this.alpha = activeDocument.channels.add()));
       activeDocument.selection.deselect();
       this.consume = function() {
          activeDocument.selection.load(this.alpha);
          this.alpha.remove();
    // The main function
    //openGroup(activeDocument.activeLayer);
    //openAllLayerSets( app.activeDocument );
    //closeGroup(activeDocument.activeLayer);
    //closeAllLayerSets( app.activeDocument );
    //END HERE-----------------------------------------------
    then, copy the following code and save it into the same folder, and save it under any filename you wish:
    //START HERE-----------------------------------------------
    var doc = app.activeDocument;
    var theLayer = activeDocument.activeLayer;
    var theParent = theLayer.parent;
    doc.activeLayer = theParent;
    // =======================================================
    // The main function
    //@include "LayerSetSupport.jsx"
    if (activeDocument.activeLayer.typename == 'LayerSet')
    {app.activeDocument.suspendHistory('closeGroup','closeGroup
    (activeDocument.activeLayer)');}
    //END HERE-----------------------------------------------
    now once you run the above script (the one which you gave it your own filename), it should select the parent layer and then collpase it. First make sure that the selected(active) layer is not the parent layer of the group. I beleive the main scripting here was done by csuebele, so thank him for this
    (sorry I don't know how to paste the above code into its own sub-window)

  • Select-string and eliminate the file name of searched file

    Is there a way with the select-string command to exclude the file name of the file you are searching and still get the line items that match your results? 
    Similar to the DOS find command results.  I am trying to become completely independent of a DOS window and still have to find to reduce log files and make them easy to read.
    Thanks
    Chris
    Chris J.

    Sure.  Select-String returns MatchInfo objects, and the string value of the matched line is in the Line property of the objects.
    Select-String -Pattern 'text to match' -Path 'filename.ext' |
    Select -ExpandProperty Line
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • STARTED IT, BUT STILL NEED HELP -- INPUTTTING CHARACTERS FROM LOADED FILE INTO TABLE, SELECTING STRINGS FROM TABLE AND PLACING IN NEW TABLE, SAVING NEW TABLE TO SPREADSHEET FILE

    I AM TRYING TO IMPORT CHARACTERS FROM A TAB DELIMITED FILE INTO A TABLE ON LABVIEW.  ONCE THE DATA IS IN THE TABLE I WANT TO BE ABLE TO SELECT INDIVIDUAL STRINGS FROM THE TABLE AND PLACE IT IN A NEW TABLE.  WHEN I CLICK ON A STRING I WOULD LIKE THE SELECTED STRING TO SHOW IN A TEXT BOX LABELED 'SELECTED STEP'  AFTER ALL THE SELECTED STRINGS IS IN THE TABLE I WOULD LIKE TO SAVE THE NEW TABLE AS ANOTHER SPREADSHEET -- TAB DELIMITED -- FILE, MAKING IT ACCESSIBLE TO OPEN.  HERE IS WHAT I HAVE SO FAR.  I CAN INPUT DATA INTO THE TABLE, BUT I CAN ONLY TRANSFER ONE STRING INTO THE TABLE I WOULD LIKE TO BE TO INPUT MULTIPLE STRINGS.    ALSO WHENEVER I TRY SAVING THE FILE, IT ALWAYS SAVES A UNKNOWN FILE, HOW CAN I GET IT TO SAVE AS A SPREADSHEET FILE.  THANKING ALL OF YOU IN ADVANCE FOR YOUR HELP!!!!!!
    Attachments:
    Selector.zip ‏30 KB

    Pondered,
       The question you are asking is the same one that you asked in: http://forums.ni.com/ni/board/message?board.id=170&message.id=132508#M132508, to which I supplied a revised version of the original vi you used (which was modified from the original one I supplied to an earlier thread). A couple of questions: 1) What does my latest not do that is in your question, 2) Why are you starting yet another thread about the same problem?  We are here trying to help, it makes it a lot easier if you keep the same problem in the same thread, it reduces duplication of effort from those that might not have been following the previous thread(s).  Those of us that don't have our "names in blue" are just doing this "for fun" (the blue names are NI employees, who may still be doing it "for fun"), and it makes it more fun if it doesn't seem (correctly or not) that our attempts are ignored.  If an answer doesn't help, or seems incomplete, post a little more detail to the same thread so that the original respondent, or someone new, can provide more information, or understand your problem better.
    P.M.
    Message Edited by LV_Pro on 07-20-2005 01:20 PM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

Maybe you are looking for