Remove first 30 characters from get-content

hello
i have a one liner which reads a file and filter it based on my criteria. the output is very lengthy. i need to remove the first 35 characters of that in order to have a clear result with no unwanted information
Get-Content D:\netlogon.bak | Select-String -Pattern "CHI-*"
after I filter based on pattern, i want to remove the first 35 charaters. how can i do this?
thank you

Get-ContentD:\netlogon.bak
| Select-String
-Pattern
"CHI-*" | %{$_.SubString(35,$_.Length-35)}
\_(ツ)_/

Similar Messages

  • How can I remove the applications from the Content Administrator

    I had undeployed the applications from Content Administrator in two ways:
    A:
    1. Start the tool using the go.bat located in \usr\sap\<SID>\<Instance Name>\j2ee\admin folder
    2. Log in with an Administrator user.
    3. Under the Server node click Services-> Deploy.
    4. In the runtime tab, on the right hand side screen click on the Applications checkbox. The list of all deployed applications appears.
    5. Select the application and click on the Remove button.
    B:
    Undeploying using SDM remoteGUI.
    after I finished that,the application still exist in the browse of Content Administrator Web Dynpro.
    But it is'n invailable.When I click the application name,it throws exceptions:
    Failed to get the list of names of referenced deployable objects for deployable object 'local/Welcome'.
    Failed to get list of defined JCO clients for deployable object 'local/Welcome'.
    Failed to get the list of names of referenced deployable objects for deployable object 'local/Welcome'.
    Failed to get enable state for 'local/Welcome'.
    No resource bundles found for development component ''local/Welcome''.
    My question is , how can I remove it form the list.

    Hi,
       Have you restarted the server after removing the application from the Visual Admin?
    Regards,
    Satyajit.

  • Remove special characters from incoming data

    Hi Varun, You could use either of below.. REG_REPLACE(YOUR_INPUT_STR,^[A-Za-z0-9 ],NULL)  -- Replaces all non-alphanumeric with null
       REG_EXTRACT(YOUR_INPUT_STR,[A-Za-z0-9 ]) -- Extracts only alphanumeric data -Rajani

    i have special character coming in the source data and i want to remove it before loading into target, currently i am getting one special character , it may come as some other type of special character  other than alpha numeric. so how to remove those special characters from data and load the alphanumeric data into target.

  • Sql to remove special characters from my search

    Hi everyone.  I'm very new to sql and have hit another road block.  I am doing a query on my database in oracle sql developer.  I want to search manufacturer numbers but sometimes they were entered with dashes ( 999-99-9999) and other times not (999999999)  is it possible to apply a function to overlook the dash in both my query numbers and in the database mfr_nbr column?
    any help would be appreciated.
    Kelly

    ok,  I have built a nesting string of replaces to remove all of my special characters and it worked perfectly but now I am not sure where to place the nest later in the string to remove it from my search of mfr numbers.  The reason I need to do it again is because I want to remove the characters so I am searching in terms of " apples to apples" so to speak.   here is my string so far. I still need to add the part where I put in my search for the manuf_item_nbr.  my question is  where do I need to place the nested replace's to remove it from my numbers I'm going to search?
    SELECT  MAX(item_nbr) ,REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( manuf_item_nbr, ' '), ','), '<'), '.'), '>'), '?'), ''), '"'), ';'), ':'), '\'), '|'), ']'), '}'), '['), '{'), '='), '+'), '_'), '-'), ')'), '('), '*'), '&'), '^'), '^'), '%'), '$'), '#'), '@'), '!'), '~'), '`'),
      manuf_item_nbr  ,MAX(description), MAX(description2), MAX(GHX_FULL_ITEM_DESCR), MAX(Cntrct_nbr_txt), MAX(uom_cd)   ,
    MAX(item_qty), MAX(tier_descr), MAX(tier_prc_amt),MAX(list_prc_amt), MAX(vndr_nm), MAX(vndr_id), MAX(unspsc_nbr),MAX(iss_account)   FROM
    ( SELECT '' AS item_nbr, manuf_item_nbr,'' AS description, '' AS description2,'' AS GHX_FULL_ITEM_DESCR, Cntrct_nbr_txt, uom_cd, CAST(item_qty AS VARCHAR (255)) AS item_qty,tier_descr, CAST ( tier_prc_amt AS VARCHAR (255)) AS tier_prc_amt, CAST (list_prc_amt AS VARCHAR (255)) AS list_prc_amt,
    vndr_nm, '' AS vndr_id, '' AS unspsc_nbr,'' AS iss_account FROM ROI.CNTRCT_PRC_LIST
    WHERE ACTN_CD <> 'D'
    AND ROW_UPDT_TSP IS NULL 
    UNION ALL
    SELECT item_nbr, manuf_item_nbr,'', '', GHX_FULL_ITEM_DESCR,'',  purch_uom_txt  AS uom_cd,
      purch_qoe_txt  AS item_qty, '',  '' AS tier_prc_amt,'' AS list_prc_amt,
    vndr_nm, vndr_id, unspsc_nbr,
      gl_cd  AS iss_account
      FROM ROI.ROI_ITEM_ENRCHD_NUVIA
       UNION ALL
    SELECT  trim(item)  AS item_nbr,
       trim(manuf_nbr)  AS manuf_item_nbr,
       trim(description),
       trim(description2), '' AS GHX_FULL_ITEM_DESCR, '',
        trim(stock_uom ) AS uom_cd,
        ''  AS item_qty,'', '','' AS tier_prc_amt, '' AS list_prc_amt,'' AS vndr_id, '' AS unspsc_nbr,
        CAST( trim(iss_account) AS VARCHAR(255))
          FROM ITEMMAST_LAW
    )GROUP BY manuf_item_nbr
       ORDER BY manuf_item_nbr

  • Remove LF characters from file names

    I have a folder full of files with filenames that contain LF character (ASCII code 10).  I want to use Automator's "Replace Text" funcion to remove these non printing characters from file names.  Is there a way to do it?
    If automator is not able to do this task, I will take a bash script or applescript solution as well...

    Take a look at: http://stackoverflow.com/questions/4417588/sed-command-to-fix-filenames-in-a-dir ectory
    (I changed  tr -d "\r\n" to tr -d "\n", but try both)
    for f in ~/Desktop/*
    do
        new="$(printf %s "$f" | tr -d "\n")"
        if [ "$f" != "$new" ]; then
            mv "$f" "$new"
        fi
    done

  • Problem with macro expansion removing ? characters from macros

    Hi,
    When compiling the following code (CC ex.cpp), we always receive the error line 28: Error: Unexpected ":" found.
    ex.cpp
    #include <stdio.h>
    #include <stdarg.h>
    #include <string.h>
    #define ONE 1
    #define MCheck(n) (n == ONE ? "One" : "???")
    #define F1(buff, size, ...) func(buff, size, __VA_ARGS__)
    #define F(...) F1(acBuff, sizeof(acBuff), __VA_ARGS__)
    void func(char* buff, size_t len, const char* fmt, ...) {
        va_list args;
        va_start(args, fmt);
        size_t nWrote = vsnprintf(buff, len, fmt, args);
        va_end(args);
    int main(void) {
        char acBuff[10];
        // Parsed OK
        F1(acBuff, sizeof(acBuff), "%s\n", MCheck(1));
        printf("%s", acBuff);
        // Causes error
        F("%s\n", MCheck(1));
        printf("%s", acBuff);
        return 0;
    }This appears to be because the pre-processed code (found using CC -E ex.cpp) has removed the '?' characters from the parsed macro 'F' expansion as shown:
    (Code inserted from headers)
    #13 "ex.cpp"
    void func ( char * buff , size_t len , const char * fmt , ... ) {
    va_list args ;
    ( void ) ( args = ( __va_list ) & __builtin_va_alist ) ;
    size_t nWrote = vsnprintf ( buff , len , fmt , args ) ;
    ( void ) 0 ;
    int main ( void ) {
    char acBuff [ 10 ] ;
    func ( acBuff , sizeof ( acBuff ) , "%s\n" , ( 1 == 1 ? "One" : "???" ) ) ;
    printf ( "%s" , acBuff ) ;
    func ( acBuff , sizeof ( acBuff ) , "%s\n" , ( 1 == 1 "One" : "???" ) ) ;
    printf ( "%s" , acBuff ) ;
    return 0 ;
    }Is this an error with the compiler, or is there some flag we need to set to ensure the macros are expanded to the correct level?

    Bwadly wrote:
    Hi Maxim,
    Thanks for the feedback.
    We are using Solaris 8, so I'm guessing we should use Sun Studio 11? Correct, the latest release that supports Solaris 8 is Sun Studio 11. Be sure to patch both Solaris and Sun Studio once you install it.
    BTW, I was able to reproduce the problem using Studio 9 compiler (CC 5.6). Apparently, it got fixed in later versions of compiler - patched version of CC 5.6 does not have it.
    Edited by: MaximKartashev on 15.08.2008 12:55

  • Excel - Remove specific characters from entire worksheet if they are the first 2 in the cell

    Hello,
    I have a very large worksheet that is used to populate a SQL database.
    I need to have the data clean before I pass it on to the owner of that database.
    The data is riddled with "na" where the supplier of the data sometimes leaves it blank, like they should, but instead sometimes puts in "na" as either "not applicable" or "information not available". 
    I just need the all "na" removed.  If I highlight the entire sheet and replace "na" with nothing then where it says "international" it will say "inertional" and I can't have that.
    I need a routine, with an on-click for a button, probably, that removes all of the "na" that comes first in the cell.
    I've seen where you can do it with individual cells, but not looping through the whole spreadsheet.
    Thank you in advance for any help I can get! 
    Gee

    >>then where it says "international" it will say "inertional"
    Selecting the "match entire cell contents" option may give you what you want.

  • How to remove the characters from first and last position of a string?

    Hi all,
    I am creating an application where i am using vb script to export the data to excel.
    In the excel sheet most of the values are entered with double " quotes.
    so the entry looks like ""http://www.sap.com"".
    Notice that it is starting with "" and not " . so the vb takes it as a line feed and shows an error .
    It will be great if anybody can tell me how to remove these set of quotes ,so that the value should come as "http://www.sap.com" . A sample code wil be of great help.
    Thanks in advance,
    mahima.

    Hi,
    To modify you excel you have 2 options, 1) you can filter them in excel itself by using filter ...etc in excel itself. or 2) you can do it by using ABAP code.
    Below code may help you.
    Get the data from Excel to Internal table using FM :
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      exporting
        filename                = 'c:\temp\test.xls'
        i_begin_col             = 1
        i_begin_row             = 1
        i_end_col               = w_values
        i_end_row               = 10
      tables
        intern                  = t_alsmex_tabline
      exceptions
        inconsistent_parameters = 1
        upload_ole              = 2
        others                  = 3.
    Now replace all unwanted "" in internal table with space.
    replace all occurrences of '""' in itab-field with '   '.
    Again you can export to Excel using
      call function 'GUI_DOWNLOAD'
        exporting
          filename                = lv_file
          filetype                = 'DAT'
          append                  = ' '
          write_field_separator   = 'X'
        tables
          data_tab                = itab.

  • How to get 4 first characters from a full name ?

    Hello,
    in my database I can choose the value Last_Name; this generates the full last name of someone. In a DECODE I would only like to get the first 4 characters of the Last_Name.
    How can I make this in a DECODE ?
    Thanks for you help.
    Anouk

    I was searching for the wrong thing I guess....
    Your solution works perfect; thanks!
    Greetings,
    Anouk

  • File Content Conversion: Remove reserved characters from Content

    Hi PI Gurus,
    we're facing a little problem with FCC in File Receiver Adapter.  Sometimes the defined fieldSeparator ("|") comes within the field content.
    e.g.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Positions xmlns:ns0="http://test.com">
    <Position>
    <Value1>001</Value1>
    <Value2>Test|Content</Value2>
    </Position>
    </ns0:Positions>
    So, my first thought was to replace all "|" with a litte java mapping beind the actual mapping.
    But, is there any possibility to achieve this via configuration of FCC (something like fieldSeperatorSubstitution)?
    Help is as always highly appreciated!
    Cheers,
    Matthias Kral

    Hello Hareenkumar,
    yes you're totally right. I ran in several OutOfMemoryError while testing the code above. The errors started with messages over 15 MB.
    Here's the code, that is productive now. It replaces all Pipes "|" by Slashes "|" and really works fine and performant.
    public void execute(InputStream in, OutputStream out)
              throws StreamTransformationException {
              try {
                   int totalCount = 0;
              byte[] buf = new byte[40960];
              int count = 0;
                   while (count >= 0) {
                        count = in.read(buf);
                        totalCount += count;
                        if (count > 0) {
                             for (int i=0; i<count; i++){
                                  if (buf<i>==124){
                                       buf<i> = 47;
                             out.write(buf, 0, count);
              } catch (IOException e) {
                   throw new StreamTransformationException(e.getMessage());
    Thank you all again!!!
    Cheers Matthias

  • How to remove white spaces from XML content using Coldfusion?

    Hi,
    Can anybody help me in removing white spaces in between the tags from the below XML content using coldfusion?
    XML content:
    <?xml version="1.0" encoding="UTF-8"?> <chart showdates="true" today="08/12/2009"> <phases> <phase color="CCFFCC" name="Funded"/> <phase color="CDCD67" name="Concept"/> <phase color="99CCFF" name="Feasibility"/> <phase color="0099FF" name="Development"/> <phase color="0099FF" name="Development"/> <phase color="CC99FF" name="Close-out"/> <phase color="909090" name="Sustaining"/> </phases><program name=""> <project enddate=" 30/03/2007 " id="43250" startdate=" 28/02/2006 "> <version enddate=" 30/03/2007 " number=" 1" startdate=" 28/02/2006 "> <phase color="CCFFCC" currentdate="23/03/2006" name="Project Start" plandate="28/02/2006" type="phase"/> <phase color="99CCFF" currentdate="04/04/2006" name="Feasibility Closure" plandate="31/05/2006" type="phase"/> <phase color="0099FF" currentdate="29/03/2007" name="Commercialization" plandate="30/12/2006" type="phase"/> <phase color="CC99FF" currentdate="30/03/2007" name="Project Closed" plandate="30/03/2007" type="phase"/> <phase color="909090" currentdate="" name="Obsolescence" plandate="" type="phase"/> </version> </project> </program> </chart>
    Output I am expecting is like below,
    <?xml version="1.0" encoding="UTF-8"?><chart showdates="true" today="08/12/2009"><phases><phase color="CCFFCC" name="Funded"/><phase color="CDCD67" name="Concept"/><phase color="99CCFF" name="Feasibility"/><phase color="0099FF" name="Development"/><phase color="0099FF" name="Development"/><phase color="CC99FF" name="Close-out"/><phase color="909090" name="Sustaining"/></phases><program name=""><project enddate=" 30/03/2007 " id="43250" startdate=" 28/02/2006 "><version enddate=" 30/03/2007 " number=" 1" startdate=" 28/02/2006 "><phase color="CCFFCC" currentdate="23/03/2006" name="Project Start" plandate="28/02/2006" type="phase"/><phase color="99CCFF" currentdate="04/04/2006" name="Feasibility Closure" plandate="31/05/2006" type="phase"/><phase color="0099FF" currentdate="29/03/2007" name="Commercialization" plandate="30/12/2006" type="phase"/><phase color="CC99FF" currentdate="30/03/2007" name="Project Closed" plandate="30/03/2007" type="phase"/><phase color="909090" currentdate="" name="Obsolescence" plandate="" type="phase"/></version> </project></program></chart>
    Thanks in advance,
    Regards,
    Manoz.

    Daverms,
    Thanks for the quick turn around..
    I have applied the solution what you suggested above (<cfprocessingdrirective suppresswhitespaces="yes"), still whitespaces are existing in my output.
    The output what I am getting is,
    (blue color part is my output & red color indicates whitespaces)
    <?xml version="1.0" encoding="UTF-8"?>
    <chart showdates="true" today="09/12/2009">
    <phases>
    <phase color="CCFFCC" name="Funded"/>
    <phase color="CDCD67" name="Concept"/>
    <phase color="99CCFF" name="Feasibility"/>
    <phase color="0099FF" name="Development"/>
    <phase color="0099FF" name="Development"/>
    <phase color="CC99FF" name="Close-out"/>
    <phase color="909090" name="Sustaining"/>
    </phases>
    <program name="">
    <project enddate=" 01/01/2010 " id="12059" startdate=" 20/06/2003 ">
    <version enddate=" 01/01/2010 " number=" 1" startdate=" 20/06/2003 ">
            <phase color="CCFFCC" currentdate="20/06/2003" name="Project Start" plandate="20/06/2003" type="phase"/>
            <phase color="CDCD67" currentdate="" name="Concept Closure" plandate="" type="phase"/>
            <phase color="99CCFF" currentdate="20/06/2003" name="Feasibility Closure" plandate="20/06/2003" type="phase"/>
            <phase color="F0FF00" currentdate="" name="Alpha Test" plandate="" type="milestone"/>
            <phase color="F0FF00" currentdate="26/07/2004" name="Beta Test" plandate="31/05/2004" type="milestone"/>
            <phase color="0099FF" currentdate="29/06/2005" name="Commercialization" plandate="08/12/2004" type="phase"/>
            <phase color="CC99FF" currentdate="24/02/2006" name="Project Closed" plandate="01/01/2010" type="phase"/>
            </version>
    <subproject enddate=" 16/10/2008 " id="11809" name="espWatcher Pricing Toolkit" startdate=" 01/08/2003 ">
    <version enddate=" 16/10/2008 " number=" 1" startdate=" 01/08/2003 ">
            <phase color="CCFFCC" currentdate="01/08/2003" name="Project Start" plandate="01/08/2003" type="phase"/>
            <phase color="99CCFF" currentdate="" name="Feasibility Closure" plandate="" type="phase"/>
            <phase color="0099FF" currentdate="15/06/2005" name="Commercialization" plandate="08/12/2004" type="phase"/>
            <phase color="CC99FF" currentdate="16/10/2008" name="Project Closed" plandate="16/10/2008" type="phase"/>
            </version>
    </subproject>
    <subproject enddate=" 31/12/2070 " id="35704" name="espWatcher version 2 (2005)" startdate=" 01/01/2005 ">
    <version enddate=" 31/12/2070 " number=" 1" startdate=" 01/01/2005 ">
            <phase color="CCFFCC" currentdate="01/01/2005" name="Project Start" plandate="01/01/2005" type="phase"/>
            <phase color="99CCFF" currentdate="01/07/2005" name="Feasibility Closure" plandate="01/07/2005" type="phase"/>
            <phase color="0099FF" currentdate="31/03/2006" name="Commercialization" plandate="31/03/2006" type="phase"/>
            <phase color="CC99FF" currentdate="31/12/2070" name="Project Closed" plandate="31/12/2070" type="phase"/>
            </version>
    </subproject>
    </project>
    </program>
    </chart>
    However this solution removes most of the whitespaces, I want exact output as flash file is expecting so..
    Where ever I am calling the CF functions, there I am getting the whitespaces. like below cases.
    startdate="#getProjectStartDate(sProjectIdList)#" -> output I am getting for this statement is -> " 12/09/2009 "
    Please assist me...
    Regards,
    Manoz.

  • Script to remove first characters of a PDF filename?

    I know this should be easy, but I'm not a coder and don't have many occasions to write scripts.  I hope this is like a two second request for someone out there.  All I'd like to do is point a script at a PDF that will look at the filename, chop off the first two characters of the filename, and resave over the original file.  I need to do this to about 400 PDFs on a recurring basis, hence the need for a script.  So for example, if I have a file C:/temp/myFile.pdf, I'd like the script to rename the file to just "File.pdf". 
    Any help would be greatly appreciated.
    jbf

    You've both been an immense help.  Unfortunately I do have commas in my file names (which are auto-generated by another system over which I have no control).  I tried to get around this with the following, but no dice:
    var filePath = this.path.replace(this.documentFileName,"");
    var newFileName = this.documentFileName.substring(2);
    newFileName.replace(",","");
    this.saveAs(filePath + newFileName);
    What am I missing?  The console tells me the error is with the saveAs function, so if the error comes from there, it seems like one of the two replace functions isn't doing its job. 

  • Remove previous issues from Adobe Content Viewer

    We do not have a DPS licence as yet, but as part of the process to get the business to sign up we have created some example docs in InDesign and shared with the decision makers directly.
    We now want to remove some of these examples, and have 'unshared' the folios but they are still appearing in the Content Viewer?  If I delete the issue, the thumbnail remains with the option to download it again.
    Help?

    On the iPad, you (or your clients) need to tap the gear icon in the upper right corner of the library and choose "Remove Issues from iPad." Then you select the downloaded folios and delete them. If the folios have been unshared or removed from the server, they'll no longer appear in the library.

  • Removing MAP channels from desktop content page

    Currently, the channels that I have created that are only for mobile devices still show up in the Content page on the desktop. If they are selected, an empty channel shows up on the desktop. I have tried listing all the real desktop channels for the defaultHTML client type in the portal, but it does no good. Any suggestions?
    Is there a tag I can use from withing the contentTemplate.html page to get the list of available channels and then make a check to see if they are supposed to be available to the genericHTML client type?
    Thanks for any assistance,
    Mary Cole

    Mary,
    In iPS 3.x any channel selected to appear on the desktop/wireless client will show up in the content page (within the desktop). There is no available method to check the list of available channels to be able to selectively display channels in the portal desktop. This functionality is only present in MAP. That being said, you can prevent/alter the rendering of the MAP channel by either removing the template(html) and keeping only the wml templates or by editing the display template to indicate that the channel is for MAP only.
    This problem is solved in PS 6.x where there is the ability to implement a "router" container channel that directs the user to a specific container channel based on their device type. Here each device specific container channel has its own channel list.
    HTH!
    Satish

  • [Forum FAQ] How to remove div characters from multiline textbox field in SharePoint 2013

    Scenario:
    Need to avoid the div tags and get data alone from multiline textbox field using JavaScript Client Object Model in SharePoint 2013.
    Solution:
    We can use a regular expression to achieve it.
    The steps in detail as follows:
    1. Insert a Script Editor Web Part into the page.
    2. This is the complete code, add it into the Script Editor Web Part and save.
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js");
    function retrieveListItems() {
    // Create an instance of the current context to return context information
    var clientContext = new SP.ClientContext.get_current();
    //Returns the list with the specified title from the collection
    var oList = clientContext.get_web().get_lists().getByTitle('CustomListName');
    //use CAML to query the top 10 items
    var camlQuery = new SP.CamlQuery();
    //Sets value that specifies the XML schema that defines the list view
    camlQuery.set_viewXml('<View><RowLimit>10</RowLimit></View>');
    //Returns a collection of items from the list based on the specified query
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(this.collListItem, 'Include(Title,MultipleText)');
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
    //Returns an enumerator to iterate through the collection
    var listItemEnumerator = this.collListItem.getEnumerator();
    //Remove div tag use a regular expression
    var reg1 = new RegExp("<div class=\"ExternalClass[0-9A-F]+\">[^<]*", "");
    var reg2 = new RegExp("</div>$", "");
    //Advances the enumerator to the next element of the collection
    while (listItemEnumerator.moveNext()) {
    //Gets the current element in the collection
    var oListItem = listItemEnumerator.get_current();
    alert(oListItem.get_item('MultipleText').replace(reg1, "").replace(reg2, ""));
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Result:<o:p></o:p>
    References:
    http://www.w3schools.com/jsref/jsref_obj_regexp.asp
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Nice article :)
    If this helped you resolve your issue, please mark it Answered

Maybe you are looking for