Find number of occurances of a particular character

Hi,
is there any keyword to determine number of times a particular character is present in the string,
E.g. VAR1 = 'ghghj#ghjgjgh#ghjghjg#ghjg#'.
I want to find number of occurances of # in VAR1.
Regards,
Raghavendra

Hi,
       use folowing logic.
       data:begin 0f itab,
                var1 type c,
                 var2 type c,
                 var3 type c,
                  var4 type c,
              end of itab.
  split var1 at '#' into itab-var1 itab-var2 itab-var3 itab-var4.
    if not itab-var1 is initial.
        count = count + 1.
    endif.
       if not itab-var2is initial.
        count = count + 1.
    endif.
    if not itab-var3is initial.
        count = count + 1.
    endif.
    if not itab-var4is initial.
        count = count + 1.
    endif.
write count.
regards
amole

Similar Messages

  • To find out the POSITION OF Nth OCCURANCE OF A PARTICULAR CHARACTER

    Hi,
    Is it possible to find out the POSITION OF Nth OCCURANCE OF A PARTICULAR CHARACTER IN A STRING in crystal reports?
    Eg:
    I have a string abcdabcdabcd
    Now I want to know the position of the 2nd occurance of u2018au2019 in the string u2018abcdabcdabcdu2019

    hi,
    dim MainStr as String=u2018abcdabcdabcdu2019
    dim SubStr as String='a' 'Give which alphabet do you want.
    dim Num as integer=2 'Give which 'a' do you want. i gave for second a.
    dim ResultStr as string
    dim ResultNum as integer=1
    dim Position as integer=0
    for i as integer=0 to MainStr.length-1
    ResultStr=MainStr.SubString(i,1)
    if ResultStr=SubStr then
    ResultNum+=1
    if ResultNum=Num then
    position=i+1
    exitfor
    endif
    endif
    next
    hope this solves your problem
    regards,
    varma

  • Function in oracle to find number of occurances of a character in a string

    hi,
    is there any function in oracle to find the number of ocurrances of a character in a string ?
    or is there any simple way of doing the same, rather than writting many lines of code as my program is already very complex.
    Maria

    Hi Maria,
    I don't know of such a function in Oracle, but maybe you could use this:
    length(search_string) - length(replace(search_string, character_to_be_found))
    For example: select length('Hello') - length ( replace('Hello', 'l')) from dual;
    Hope this is what you're looking for
    Danny

  • Servlet to count the number of occurances of a particular node

    Hi
    I am looking for a servlet which will count the number of a particular node which I have supplied of an XML file.
    Can somebody please help me with this?
    Thankyou

    If you are using Xerces, after you have parsed your XML files using a DOMParser, get the document object from the parser like
    Document document = parser.getDocument();
    And then use the command getElementsByTagName("*"); // for all elements
    it will return the node list object (NodeList) which you can get the count (nodeList.getLength())

  • How to find number of occurance of each number in big list of numbers?

    I got big list of numbers.
    examples......4,6,30,39,27,6,25,5,6,4,
    I want to find,
    4 occur 2 times
    6 occur 3 times
    etc...
    How to do this?.
    Do we have a custom tag doing this?.
    Please let me know

    dan bracuk was my insipiration for this suggestion...
    <cfset arr = ListToArray("4,6,30,39,27,6,25,5,6,4")>
    <cfset qry = QueryNew("tmp")>
    <cfset QueryAddColumn(qry, "num", arr)>
    <cfquery name="qTotal" dbtype="query">
    SELECT num, count(num) occur
    FROM qry
    GROUP BY num
    </cfquery>
    <cfdump var="#qTotal#">

  • Finding number of occurence of a particular substring in a string..

    erm hi..
    this is my input..
    First Name,Last Name,Address,Postal Code,Mobile//Name1,Surname1,address1,435422,45734697//Name2,Surname2,address2,435222,45234697//Name3,Surname3,address3,435022,44734697//
    i wanna find out how many times "//" appears in the input.. how do i do that? =s

    String sInput = "First Name,Last Name,Address,Postal Code,Mobile//Name1,Surname1,address1,435422,45734697//Name2,Surname2,address2,435222,45234697//Name3,Surname3,address3,435022,44734697//";
    int iTotalTimesSlash = sInput.split("//").length - 1;
    if(sInput.endWith("//")
        itotalTimesSlash++;
    if(sInput.startsWith("//")
        itotalTimesSlash++;

  • How to find Number of pages in a particular spool.

    Hi,
    Can any one tell me in which table - table field the number of pages in the spool are stored.
    There is a requirement that the list be sorted as per the number of pages present in the spool.
    Help. Points will be rewarded.
    Vinod.

    Vinod,
    Use this FM RSPO_GET_PAGES_SPOOLJOB.
    for more on spools check out this onlinehelp
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d9/4a8efb51ea11d189570000e829fbbd/frameset.htm
    Regards,
    Satish
    Message was edited by:
            Satish Panakala

  • How to find the number of occurance of a string in text field of Infopath form?

    Hi All,
    In Infopath text field, How to find the number of occurrence of a particular string in that field?
    Thanks in advance!

    You can check to see if it contains a string once by using the contains function, but there isn't a very clean way to do what you want. If you wanted to guess at the maximum number of occurrences, then you could:
    Box A has your initial. Set Box B to do a concat of string-before and string-after of Box A where it copies Box A minus the string we're looking for. Then we have Box C that does the same thing to Box B. Repeat as many times as you see necessary.
    Example:
    String: "1"
    Box A - "123451234512345"
    Box B - "23451234512345"
    Box C - "2345234512345"
    Box D - "234523452345"
    etc.
    We then have a field that has nested ifs looking backwards from Z -> A looking for a non-blank. Based on that, we return the number of occurrences. Again, this isn't clean, but it will work if you think there's a predefinable maximum.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • To find the User Exits for a particular Transaction.

    hi,
        I want to find the number of User Exits for a The Transaction MM01 or MM02,
        I serched in the forums but could not find satisfactory ans,
        I tried with:
                 T.Code-> System>Status->Prog Name>SE38>find Call Customer-Exit.
        But its not helping me,
        Please help me.
    Thanks and Regards
    Suraj S Nair.

    hi ,
    if you are new to user exist use --> follw the below methos to find the user exit for a particular transaction or t-code
    create one custom pgm in se38 and execute >selection screenenter t-code and execute it will return all the user exists for a specific transaction..
    Finding the user-exits of a SAP transaction code
    * Finding the user-exits of a SAP transaction code
    * Enter the transaction code in which you are looking for the user-exit
    * and it will list you the list of user-exits in the transaction code.
    * Also a drill down is possible which will help you to branch to SMOD.
    * Written by : SAP Basis, ABAP Programming and Other IMG Stuff
    *              http://www.sap-img.com
    report zuserexit no standard page heading.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
             tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
       select single * from tadir where pgmid = 'R3TR'
                        and object = 'PROG'
                        and obj_name = tstc-pgmna.
       move : tadir-devclass to v_devclass.
          if sy-subrc ne 0.
             select single * from trdir where name = tstc-pgmna.
             if trdir-subc eq 'F'.
                select single * from tfdir where pname = tstc-pgmna.
                select single * from enlfdir where funcname =
                tfdir-funcname.
                select single * from tadir where pgmid = 'R3TR'
                                   and object = 'FUGR'
                                   and obj_name eq enlfdir-area.
                move : tadir-devclass to v_devclass.
              endif.
           endif.
           select * from tadir into table jtab
                         where pgmid = 'R3TR'
                           and object = 'SMOD'
                           and devclass = v_devclass.
            select single * from tstct where sprsl eq sy-langu and
                                             tcode eq p_tcode.
            format color col_positive intensified off.
            write:/(19) 'Transaction Code - ',
                 20(20) p_tcode,
                 45(50) tstct-ttext.
                        skip.
            if not jtab[] is initial.
               write:/(95) sy-uline.
               format color col_heading intensified on.
               write:/1 sy-vline,
                      2 'Exit Name',
                     21 sy-vline ,
                     22 'Description',
                     95 sy-vline.
               write:/(95) sy-uline.
               loop at jtab.
                  select single * from modsapt
                         where sprsl = sy-langu and
                                name = jtab-obj_name.
                       format color col_normal intensified off.
                       write:/1 sy-vline,
                              2 jtab-obj_name hotspot on,
                             21 sy-vline ,
                             22 modsapt-modtext,
                             95 sy-vline.
               endloop.
               write:/(95) sy-uline.
               describe table jtab.
               skip.
               format color col_total intensified on.
               write:/ 'No of Exits:' , sy-tfill.
            else.
               format color col_negative intensified on.
               write:/(95) 'No User Exit exists'.
            endif.
          else.
              format color col_negative intensified on.
              write:/(95) 'Transaction Code Does Not Exist'.
          endif.
    at line-selection.
       get cursor field field1.
       check field1(4) eq 'JTAB'.
       set parameter id 'MON' field sy-lisel+1(10).
       call transaction 'SMOD' and skip first   screen.
    *---End of Program
    Regards,
    Prabhudas

  • How to find number of lines in an internal table

    Dear all,
    how to find number of records present in an internal table.

    DESCRIBE TABLE
    Syntax
    DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].
    Extras:
    1. ... KIND knd
    2. ... LINES lin
    3. ... OCCURS n
    Effect
    This statement determines some properties of the internal table itab and assigns them to the specified variables. The various additions enable you to determine the table type, the number of currently filled rows and the initial memory requirement.
    In addition, the system fields sy-tfill and sy-tleng are filled with the current number of table rows and the length of a table row in bytes.
    Notes
    For detailed information about an internal table, you should use the methods of RTTS of the DESCRIBE TABLE statement.
    Without the specification of an addition, the statement DESCRIBE TABLE only sets the system fields sy-tfill and sy-tleng.
    Addition 1
    ... KIND knd
    Effect
    The table type of the internal table itab is determined and a corresponding one-digit identification is assigned to the data object knd. A character-type data type is expected for the data object. The identifications are "T" for standard tables, "S" for sorted tables and "H" for hashed tables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed in the type group SYDES.
    Addition 2
    ... LINES lin
    Effect
    The current number of table rows of the internal table itab is determined and is assigned to the data object lin.The data type i is expected for the data object.
    Note
    As of release 6.10, the current number of rows of an internal table can also be determined using the in-built function lines.
    Addition 3
    ... OCCURS n
    Effect
    The initial memory requirement defined during the creation of the internal table with the addition INITIAL SIZE or the obsolete addition OCCURS is determined and assigned to the data object n. The data type i is expected for the data object.
    Example
    Descending sorting of a generically typed internal table in a subprogram. Since sorted tables cannot be sorted in a descending order, the table type is checked to avoid an exception that cannot be handled.
    TYPE-POOLS sydes.
    FORM sort_descending CHANGING itab TYPE ANY TABLE.
      DATA tabkind(1) TYPE c.
      DESCRIBE TABLE itab KIND tabkind.
      IF tabkind = sydes_kind-standard OR
         tabkind = sydes_kind-hashed.
        SORT itab DESCENDING.
      ELSEIF tabkind = sydes_kind-sorted.
        MESSAGE '...' TYPE 'E'.
      ELSE.
        MESSAGE '...' TYPE 'E'.
      ENDIF.
    ENDFORM.
    DESCRIBE FIELD INTO
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Syntax
    DESCRIBE FIELD dobj INTO td.
    Effect
    All characteristics of the field f, its components , sub-components etc. are displayed in the field td (type description). td has to be of the type SYDES_DESC, defined in Type Group SYDES. Because of this, the type group SYDES must be integrated into the ABAP-program with a TYPE-POOLS statement .
    The structure SYDES_DESC has two table-type components TYPES and NAMES:
    In TYPES, the tree structure of the type belonging to f is displayed. The components of a node are stored in the table TYPES in a continuous manner. Beginning and end of the line area that represents the components are stored in TYPES-FROM and TYPES-TO. The reference to the superior node can be found in TYPES-BACK. If no superior resp. subordinate node exists, then this is marked by the value 0 (For the relevance of further components, refer to the following sections).
    The names of components, types etc. are not stored directly in TYPES. Instead, the components TYPES-IDX_... hold an index in the name table NAMES. The value 0 indicates that there is no reference to the name table.
    NAMES contains the possibly fragmented names in the component NAMES-NAME. If a name continues in the following line, this is indicated by an asterisk ('*') in the component NAMES-CONTINUE.
    The type description table (TYPES) not only stores information about the tree structure but also further information about the type of f resp. its components. This includes especially all information that can be determined using the usual additions to DESCRIBE FIELD. In detail, TYPES contains the following columns:
    IDX_NAME
    Component Name
    IDX_USER_TYPE
    Name of a user-defined type, i.e., a type that was defined through its TYPES-statement. Derived types (... TYPE A-B) and structures from the ABAP-Dictionary are not considered to be user-defined types.
    CONTEXT
    For user-defined types only: The context, in which the type is defined. Possible values are defined in the constant SYDES_CONTEXT of the type group SYDES. Please only use these constants to carry out a comparison. In detail, we distinguish between the following type contexts:
    SYDES_CONTEXT-PROGRAM: Program-global type
    SYDES_CONTEXT-FORM   : FORM-local type
    SYDES_CONTEXT-FUNCTION: FUNCTION-local type
    SYDES_CONTEXT-METHOD : METHOD-local type
    IDX_CONTEXT_NAME
    For user-defined types only:
    With a local context: The name of the FORM or FUNCTION, whose type was defined. The name of the associated program is then the first entry in the name table.
    With a global context: The name of the program in which the type was defined.
    IDX_EDIT_MASK
    Conversion routine from the ABAP-Dictionary, is in accordance with the addition EDIT MASK at simple DESCRIBE.
    IDX_HELP_ID
    Help-Id when referencing to fields from the ABAP-Dictionary
    LENGTH
    Internal length, corresponds to the addition LENGTH at simple DESCRIBE
    OUTPUT_LENGTH
    Output length, corresponds to the addition OUTPUT-LENGTH at simple DESCRIBE
    DECIMALS
    Number of decimal digits, corresponds to the addition DECIMALS at simple DESCRIBE
    TYPE
    ABAP-Type, corresponds to the addition TYPE at simple DESCRIBE
    TABLE_KIND
    A table type is stored here for the components which represent an internal table. The same values are returned as with the variant DESCRIBE TABLE itab KIND k. Components which do not represent a table get the return value set to SYDES_KIND-UNDEFINED (see type group SYDES).
    Example
    Example definition of the complex data type EMPLOYEE_STRUC:
    PROGRAM DESCTEST.
    TYPES: BEGIN OF name_struc,
             first  TYPE c LENGTH 20,
             last   TYPE c LENGTH 20,
           END OF name_struc,
           BEGIN OF absence_time_struc,
             day        TYPE d,
             from       TYPE t,
             to         TYPE t,
           END OF absence_time_struc,
           phone_number TYPE n LENGTH 20,
           BEGIN OF employee_struc,
             id         LIKE sbook-customid,
             name       TYPE name_struc,
             BEGIN OF address,
               street  TYPE c LENGTH 30,
               zipcode TYPE n LENGTH 4,
               place   TYPE c LENGTH 30,
             END OF address,
             salary_per_month TYPE p LENGTH 10 DECIMALS 3,
             absent           TYPE STANDARD TABLE OF absence_time_struc
                                   WITH NON-UNIQUE DEFAULT KEY,
             phone            TYPE STANDARD TABLE OF phone_number
                                   WITH NON-UNIQUE DEFAULT KEY,
           END OF employee_struc.
    You can determine the structure of the type EMPLOYEE_STRUC by collecting the type group SYDES as follows:
    TYPE-POOLS: sydes.
    DATA: employee TYPE employee_struc,
          td       TYPE sydes_desc.
    DESCRIBE FIELD employee INTO td.
    The following table shows a few selected columns of the type description table TD-TYPES. For a better overview, the names of the columns IDX_NAME, IDX_UERR_TYPE and IDX_EDIT_MASK have been shortened:
        |FROM| TO |BACK|NAME|UTYP|EMSK|TYPE
    |--||||||--
      1 |  2 |  7 |  0 |  0 |  2 |  0 |  v
      2 |  0 |  0 |  1 |  6 |  0 |  4 |  N
      3 |  8 |  9 |  1 |  7 |  5 |  0 |  u
      4 | 10 | 12 |  1 |  8 |  0 |  0 |  u
      5 |  0 |  0 |  1 |  9 |  0 |  0 |  P
      6 | 13 | 13 |  1 | 11 |  0 |  0 |  h
      7 | 17 | 17 |  1 | 12 |  0 |  0 |  h
      8 |  0 |  0 |  3 | 13 |  0 |  0 |  C
      9 |  0 |  0 |  3 | 14 |  0 |  0 |  C
    10 |  0 |  0 |  4 | 15 |  0 |  0 |  C
    11 |  0 |  0 |  4 | 16 |  0 |  0 |  N
    12 |  0 |  0 |  4 | 17 |  0 |  0 |  C
    13 | 14 | 16 |  6 |  0 | 18 |  0 |  u
    14 |  0 |  0 | 13 | 20 |  0 |  0 |  D
    15 |  0 |  0 | 13 | 21 |  0 |  0 |  T
    16 |  0 |  0 | 13 | 22 |  0 |  0 |  T
    17 |  0 |  0 |  7 |  0 |  0 |  0 |  N
    Please note that the entries in rows 6 and 7 represent internal tables (ABAP-Type h). There is always an entry for the corresponding row type (rows 13 and 17) to an internal table.
    The indices in the rows 5 to 7 refer to entries in the name table TD-NAMES. If you look, e.g., at row 3, you find the corresponding component name in TD-NAMES from row 7 (NAME) onward and the corresponding user type from row 5 (NAME_STRUC) onward.
    In the name table TD-NAMES you find the following entries. Note that the names SALARY_PER_MONTH and ABSENCE_TIME_STRUC are stored in two parts:
        |CONTINUE|NAME                   |CONTINUE|NAME
    |--|     -||--
      1 |        |DESCTEST            12 |        |PHONE
      2 |        |EMPLOYEE_STRUC      13 |        |FIRST
      3 |        |SBOOK-CUSTOMID      14 |        |LAST
      4 |        |==ALPHA             15 |        |STREET
      5 |        |NAME_STRUC          16 |        |ZIPCODE
      6 |        |ID                  17 |        |PLACE
      7 |        |NAME                18 |   *    |ABSENCE_TIME_ST
      8 |        |ADDRESS             19 |        |RUC
      9 |   *    |SALARY_PER_MONT     20 |        |DAY
    10 |        |H                   21 |        |FROM
    11 |        |ABSENT              22 |        |TO

  • How to find out the ASCII Values for Spanish character

    Hi,
    I had an requirement to store Spanish character and also need to fileter the records based on the Spanish character.
    Kindly guide me for below.
    To filter the Records which contains spanish characters?
    To get the ASCII Values for the particular column?
    E.g. we can find out the ASCII value of 'a' by using the syntax select ASCII('a') from dual.
    But I want to find the ASCII Values for the particular column value. Ie. name.
    E.g., Client name is "Suresh", I want to the ASCII Values for entire name of "Suresh".
    Kindly do the needful help / Guidance on this.
    Thanks,
    Orahar

    To expand on what I said in my first post, you want to do something along these lines:
    with t (thename) as
      select 'Suresh' from dual
    select thename
         , substr(TheName, level, 1)
         , ascii(substr(thename, level))
      from t
    connect by level <= length(thename);The output of the above query is:
    THENAM S ASCII(SUBSTR(THENAME,LEVEL))
    Suresh S                           83
    Suresh u                          117
    Suresh r                          114
    Suresh e                          101
    Suresh s                          115
    Suresh h                          104
    6 rows selected.Note that the WITH statement is only there to simulate a table for this example. With a table, all you do is get rid of the with and substitute the name "t" for the name of your table (also the name of the column to whatever name the column has in your table).
    Lastly, I suggest you post your question along with, an example table and the output you'd like to get in the PL/SQL forum. There are people there that will give you all kinds of great ways of solving that problem.
    HTH,
    John.

  • Attempting to locate number of files of a particular extension on a SP 2010 farm

    Was doing some web searching to find the means to get a count of the number of files of a particular extension. My code is:
    Get-SPSite -Limit All | Get-SPWeb -Limit All | Select -ExpandProperty Lists | Where { $_.GetType().Name -eq "SPDocumentLibrary" –and -not $_.Hidden } | Select -ExpandProperty Items | Where { $_.Name -Like "*.exe" } | Select Name, @{Name="URL";
    Expression={$_.ParentList.ParentWeb.Url + "/" + $_.Url}} > d:\temp\exefound.txt
    (all on one line)
    I am running the sharepoint management console "as administrator".
    The above script runs to completion without error - or results.
    However, I know for certain that there are files of the "file.abc" extension.
    Therefore, there is something I am missing here.
    What improvements to the script can I make so that I get real results?
    Thank you for your suggestions!

    Well, this has been interesting. I did get the list of URLs that I needed from this script.
    Then, of course, those to whom I was reporting had a more complex request - how many files are on the system with _any_ of the blocked file extensions.
    So I did some research to see how I might modify the script. I turned your script above into this:
    $SPwebApp = Get-SPWebApplication http://mysite
    function EndsWithAny( [string]$s, [string[]]$items ) {
      $matchingItems = @($items | where { $s.EndsWith( $_ ) })
      [bool]$matchingItems
    $BlockedExtensions = @(".adp",".app",".asa",".ashx",".asmx",".asp",
    ".bas",".bat",
    ".cdx","cer",".chm",".class",".cmd",".cnt",".com",".config",".cpl",".crt",".csh",
    ".der",".dll",
    ".exe",
    ".fxp",
    ".gadget",".grp",
    ".hlp",".hpj",".hta",".htr",".htw",
    ".ida",".idc",".idq",".ins",".isp",".its",
    ".jse",".json",
    ".ksh",
    ".lnk",
    ".mad",".maf",".mag",".mam",".maq",".mar",".mas",".mat",".mau",".mav",".maw",".mcf",
    ".mda",".mdb",".mde",".mdt",".mdw",".mdz",".msc",".msh",".msh1",".msh1xml",".msh2",".msh2xml",".mshxml",".msi",".msp",".mst",
    ".ops",
    ".pcd",".pif",".pl",".prf",".prg",".printer",".ps1",".ps1xml",".ps2",".ps2xml",".psc1",".psc2",".pst",
    ".reg",".rem",
    ".scf",".scr",".sct",".shb",".shs",".shtm",".shtml",".soap",".stm",".svc",
    ".url",
    ".vb",".vbe",".vbs",".vsix",
    ".ws",".wsc",".wsf",".wsh"
    foreach ($SPsite in $SPwebApp.Sites)
        foreach ($web in $SPsite.AllWebs)
          $listCounter = $web.Lists.Count
          foreach ($list in $web.Lists)
            if($list.BaseType -eq "DocumentLibrary")
                 foreach($item in $list.Items)
                    if(EndsWithAny($item.Name, $BlockedExtensions) )
                        $web.Url + "/" + $item.Url  >>  d:\temp\exefound4.txt
    When I ran the above - which isn't much different than yours - I get 0 results instead of the nearly 200 lines before. So it looks, to me, like there is some issue with this line of the above function:
      $matchingItems = @($items | where { $s.EndsWith( $_ ) })
    When I try things from the command line, I see:
    PS C:\Users\sa_spfarm> $s = "any.f"
    PS C:\Users\sa_spfarm> $items = @( ".abc", ".f", "exe" )
    PS C:\Users\sa_spfarm> $items | where { $s.EndsWith($_) }
    .f
    PS C:\Users\sa_spfarm>
    So then I added some echos to the function:
    function EndsWithAny( [string]$s, [string[]]$items ) {
      echo "items = $items"
      echo "s = $s"
      $matchingItems = @($items | where { $s.EndsWith( $_ ) })
      echo "matchingItems = $matchingItems"
      [bool]$matchingItems
    Then I try to use the function:
    PS C:\Users\sa_spfarm> $items
    .abc
    .f
    exe
    PS C:\Users\sa_spfarm> EndsWithAny( "abc.f", $items )
    items =
    s = abc.f System.Object[]
    matchingItems =
    False
    PS C:\Users\sa_spfarm>
    So, why is items empty inside the function? Notice that the function's arguments are $s and $items internal to the function; globally the $items is passed in and I would have expected it to be assigned to the internal variable.

  • Scan\Look for a particular character in a file

    I would like to look for a particular character(@) in a file. The character might be in a word. When if find the character I want to read the actual whole word that contains that character.
    What's the best way of going abt this?
    Thx,
    Kapapra.

    Read the file line by line using BufferedReader.
    Tokenize each line on space.
    Loop through the token strings.
    For each token that contains the character that you are looking for (e.g. @) found using indexOf operator of the String class, print or save (or whatever you want to do with that token) that token.
    Continue reading the file line by line till the end of the file.
    Does this make sense? Look the java.io package API for the details on how to read the file and stuff.
    If anyone has more effecient method to do this, please share.

  • Search for a particular character in a file

    I would like to look for a particular character(@) in a file. The character might be in a word. When if find the character I want to read the actual whole word that contains that character.
    What's the best way of going abt this?
    Thx,
    Kapapra.

    Use StringTokenizer, here is example
    StringTokenizer tokenizer = new java.util.StringTokenizer(yourString, " ");
    while(tokenizer.hasMoreTokens())
       String word = (String) tokenizer.nextToken();
       if ( word.indexOf("@") >=0 )
           // word contains @
      else
            // word does not contain @
    }

  • Error attempting to write location redirection to web server (Windows NT error number -2147467259 occurred)

    I'm seeing an error pop up on a development server... error
    2408:
    "Error attempting to write location redirection to web server
    (Windows NT error number -2147467259 occurred)"
    Any idea what this is? I can't seem to find anything
    solid.

    I'm having the same problem but it just started.  Logged in last week from work computer running IE 8.0.8 with no problems.  Today I keep getting problem connecting to server.   Clicking on the error indicator gets me the same error.
    Message: Object expected
    Line: 5
    Char: 1963
    Code: 0
    URI: https://setup.icloud.com/ajax_sender.html
    Tried clearing browser history,cookies, etc.. nothing works.

Maybe you are looking for

  • Is there any way to change a title for streaming video in QT Pro?

    I'm trying to follow several streaming feeds at the same time, all with unhelpful titles. For example, this is the URL I'm using to view the ROV 2 feed for Discoverer Enterprise. http://mfile.akamai.com/97892/live/reflector:21145.asx?bkup=21327 which

  • Word processing quits when I try to print

    Thank you for taking the time to read this. Thank you even more if you can help me solve this problem! First, the basics: I'm working with an older iBook G3, using OS X (10.4.2). The problem happens with both Word:Mac (2004) and AppleWorks. The probl

  • TS3074 error 7

    Hi, i am having problems downloading  itunes 10, after downloading i get Error 7 windows 5 message. i am the administrator for this pc and have full rights. having downloaded .net framework still no joy, I am running windows vista home 32bit, i am no

  • Error About Full Text Search

    TITLE: Microsoft SQL Server Management Studio Cannot execute changes. ADDITIONAL INFORMATION: Property IsAccentSensitive is not available for FullTextCatalog '[Contact_Catalog]'. This property may not exist for this object, or may not be retrievable

  • Portable(java.lang.IllegalStateException): SafeNamedCache was exexplicitly

    Hi All, I have seen similar post in this forum, but this error looks bit different than the old post. This is the log on the TCP Node. INFO | jvm 1 | 2011/11/17 20:30:05 | 2011-11-17 20:30:05.758/92113.566 Oracle Coherence GE 3.6.1.5 <D5> (thread=Pro