Count the number of lines in a txt file

I need to count the number of lines in a txt file, but I can't do it using readLine(). This is because the txt file is double spaced. readLine() returns null even if it is not the end of the file. thanks for the help

I need to count the number of lines in a txt file,
but I can't do it using readLine(). Then just compare each single byte or char to the newline (code 10).
This is because the txt file is double spaced. readLine() returns
null even if it is not the end of the file.Errm what? What do you mean by "double spaced"? Method readLine() should only return null if there's nothing more to read.

Similar Messages

  • How to count the number of lines dynamically,

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES

    In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
    after displaying one category contents am displaying a line
    which also counts to a line in the internal table.
    My question is how to count the number of lines(ULINE) displayed dynamically.
    FORM GET_LINES .
      DATA: LV_LINES TYPE I,
            LV_TIMES TYPE I,
            LV_TABIX TYPE SY-TABIX.
      DESCRIBE TABLE IT_REC LINES LV_LINES.
      DO LV_LINES TIMES.
        LV_TIMES = SY-INDEX .
        READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
        IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
          LV_TABIX =  LV_TIMES.
          READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
          IF SY-SUBRC EQ 0.
            APPEND GWA_UPDATE TO GT_UPDATE.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_LINES
    The display function is:
    FORM DISPLAY_DATA .
      ULINE.
      WRITE :  /1 SY-VLINE, 'check',
                10 SY-VLINE, 'Plant',
               20 SY-VLINE, 'Material number',
               50 SY-VLINE, 'Follow up material',
               70 SY-VLINE, 'Safety stock',
              100 SY-VLINE, 'Partc'.
      ULINE.
      LOOP AT IT_MARC.
        MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
              IT_MARC-MATNR TO IT_REC-MATNR,
              IT_MARC-NFMAT TO IT_REC-NFMAT,
              IT_MARC-EISBE TO IT_REC-EISBE,
              IT_MARC-PARTC TO IT_REC-PARTC .
        APPEND IT_REC.
        CLEAR IT_MARC.
      ENDLOOP.
      DATA: GV_TABIX TYPE SY-TABIX.
      LOOP AT IT_REC.
        GV_TABIX = SY-TABIX.
        READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
                                     NFMAT = IT_REC-NFMAT.
        IF SY-SUBRC EQ 0.
          IT_REC-PARTC = GT_TOTAL-PARTC.
          MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
        ENDIF.
      ENDLOOP.
      LOOP AT IT_REC.
        WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
                10 SY-VLINE, IT_REC-WERKS,
                20 SY-VLINE, IT_REC-MATNR,
                50 SY-VLINE, IT_REC-NFMAT,
                70 SY-VLINE, IT_REC-EISBE,
               100 SY-VLINE, IT_REC-PARTC.
        AT END OF NFMAT.
          ULINE.
        ENDAT.
      ENDLOOP.
      ULINE.
    ENDFORM.                    " DISPLAY_DATA
    Solved

  • Count the number of lines in  each file in a directory

    Hello,
    I would like to count the number of lines for each file in my directory and subdirectories.
    I wonder how can I count the lines of the specified files?
    Here is the program which is listed the files in the specified directory:
                        String path = "C:/User/Studies/Pracices/src/Pract1";
           String files;
           File folder = new File(path);
           File[] listOfFiles = folder.listFiles();
           for (int i = 0; i < listOfFiles.length; i++)
            if (listOfFiles.isFile())
         files = listOfFiles[i].getName();
         System.out.println(files);

    Ok so one more question.
    Actually my path is pointing to one Directory and like here I can just read from one file that the name of the file should be specified in the path is it possible to help me in that part?
    File f = new File("C:/User/Studies/Practices/src/Pract1/");
    FileReader fr = new FileReader(f);
          BufferedReader br = new BufferedReader(fr);
          String str = br.readLine();
              LineNumberReader ln = new LineNumberReader(br);
              int count = 0;
              while (ln.readLine()!=null)
                  count++;
              System.out.println("no. of lines in the file = " + count);

  • Count the Number of Lines

    Hi All,
    I want to count the Number of lines that the user had entered in a multi-lined text box.
    Because I want to restrict him up-to 6 lines.
    How Can I don this.
    Thanks in Advance,

    sql>select length('count no
                      of line
                      in the text')-length(replace('count no
                                                  of line
                             in the text',chr(10),'')) lines
        from dual;
    LINES 
    2
    jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Java Program+To count the number of lines in a method excluding comments???

    Hi friends
    can u plz help me out, the java program is counting the number of lines in a method excluding comments.
    The first thing is how to identify a method, then there can be an inner method inside the parent method,
    Please friends its urgent
    Bye
    Sandy

    There's no such thing as an inner method in Java. You can either write the code yourself to parse Java source, or maybe something like ANTLR can do it.

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How to calculate the number of vowels from a txt file. Pls give me a hand!!

    Guys! How do i calculate the number of vowels from a txt file? I have to create a program to count the number of words, sentence, and vowels. So far I had managed to count the number of words. Now I need help on counting sentence and vowels! Pls give me a hand guys!

    I first have to read from the file not the string.I
    know how to read from a file. Now the problem ishow
    to compare a character from a txt file!You fail to understand, that you have read the data
    from the file into a string. Now loop over all
    characters in the string. Forget about the file.
    KajOr forget the scanners just as others have told you. Just read the file character by character using a FileReader.
    Kaj

  • Count the number of comments in a PDF file automatically?

    Hello O Experts,
    My documentation team members use Acrobat and Reader 8, and frequently need to count the number of comments in a PDF file. Is it possible to count the number of comments automatically? We can't find this functionality anywhere, and have to resort to manual counting. Since our PDFs can contain thousands of comments, this is very time-consuming. I've tried searching the Web and these forums, but the words "count" and "comments" are too frequent in other contexts to find anything useful...
    Thanks and best regards,
    --M.T.

    Hi again sypark,
    That is a great idea, and it works!
    I would actually search on a more unique phrase - for instance, "Subject:" - that definitively occurs a single time per comment. The reason is:
    There are many types of comments, not just sticky notes... you have highlights, text deletions, text insertions, replacement text, attachments, callouts, and so on. But each of them has a "Subject:" in the summary.
    It's best to avoid searching for the comment names because they differ by language (an important issue when you work with colleagues in multiple countries). For example, the name of the "Highlight" comment type in French is "Texte surligné" - so you'd have to search for the latter term to get an accurate count.
    In any case, your method is flexible and allows for easy customization of comment counts. Many thanks for your effective help!
    Cheers,
    --Michael

  • Counting the number of lines for each procedure in a package

    Hi,
    I would like to write a query on USER_SOURCE that can display the number of code lines for each procedure/function in a package.
    Is it possible to write such a query? Maybe by using analytical functions?
    for example in the following example i would like to count the lines between "PROCEDURE proc1 IS" and "END proc1;" and between "PROCEDURE proc2 IS" and "END proc2;"
    SQL> select text  from user_source where name='PKG_TEST' and type='PACKAGE BODY';
    TEXT
    PACKAGE BODY PKG_TEST IS
      PROCEDURE proc1 IS
      BEGIN
        update t1 set EDITION_NAME = 'AAAAAAA';
        commit;
      END proc1;
    PROCEDURE proc2 IS
      BEGIN
       update t1 set EDITION_NAME = 'AAAAAAA';
        commit;
      END proc2;
    END PKG_TEST;thanks for helping

    onedbguru wrote:
    Hopefully some idiot manager isn't trying to use this sort of thing to base their decisions on developer productivity. If so, they ARE idiots. Number of code lines NEVER, EVER, EVER!!! translates into an efficient application. If I were paid by the line, my code would look like:
    select
    1
    from
    dual
    Based on the idiocy of this method of determining "performance" I would get paid $5.00 at $1.00/line. And trust me, I saw this back in the 80's and 90's and saw similar idiotic code and had to clean up the mess. Most of it wasn't efficient code to start with let alone the number of lines generated.Or the other extreme, when the PHB firmly believed that execution efficiency was gained by reducing the number of lines of code. So instead of nicely formatted, easy to read code:
          *GET NEXT ORDER NUMBER                                                               
                EXEC SQL                                                                        
                     SELECT (MAX(ORDER_NUM) + 1)                                                
                     INTO   :NEXT-NUM:IND-NULL                                                  
                     FROM   PART_ORDER                                                          
                END-EXEC.                                                                       
                IF IND-NULL < 0                                                                 
                  MOVE 1 TO NEXT-NUM.                                                           
                EXEC SQL                                                                        
                     INSERT                                                                     
                     INTO    PART_ORDER                                                         
                            (ORDER_NUM,                                                         
                             ORIGIN_LOC,                                                        
                             ORDER_TYPE,                                                        
                             ORDER_STAT,                                                        
                             CREAT_TIME)                                                        
                     VALUES (:NEXT-NUM,                                                         
                             :LOC, 'R', 'O',                                                    
                             CURRENT TIMESTAMP)                                                 
                   END-EXEC.                                                                    
                MOVE NEXT-NUM TO MASK0.                                                         
                PERFORM HEADER-PROC THRU HEADER-EXIT.                                           
            CREATE-ORDER-EXIT. EXIT.                                                     You got this:
           *GET NEXT ORDER NUMBER
            EXEC SQL SELECT (MAX(ORDER_NUM) + 1) INTO :NEXT-NUM:IND-NULL FROM
            PART_ORDER END-EXEC. IF IND-NULL < 0 MOVE 1 TO NEXT-NUM. EXEC SQL INSERT
            INTO PART_ORDER (ORDER_NUM, ORIGIN_LOC, ORDER_TYPE, ORDER_STAT,
            CREAT_TIME) VALUES (:NEXT-NUM, :LOC, 'R', 'O', CURRENT TIMESTAMP)
            END-EXEC. MOVE NEXT-NUM TO MASK0. PERFORM HEADER-PROC THRU HEADER-EXIT.
            CREATE-ORDER-EXIT. EXIT.                 Oh, wait! See the same thing all the time in this forum ... not because someone thinks fewer lines = faster code, but simply because people are sloppy.
    INSERT INTO PART_ORDER(ORDER_NUM,ORIGIN_LOC,ORDER_TYPE,ORDER_STAT,CREAT_TIME) VALUES (:NEXT-NUM,:LOC, 'R', 'O',CURRENT TIMESTAMP) ;

  • Count the number of Lines with in a method

    I am trying to write a program that will report back the number of methods/types/names and proxies as well as the number of lines of code in each method... I can not figure out how to count each methods line of code separately thanks. each method is commented by
    /* PROXY proxyname type */
    /* METHOD method name*/
    public class Assignment3
    private static BufferedReader userInput = new BufferedReader (new InputStreamReader (System.in));
         * @param args
         * @throws IOException
         * @param args
         * @throws IOException
         public static void main(String[] args) throws IOException
              System.out.print("Enter the .java file name: ");
         String input = userInput.readLine();
         while (!input.equalsIgnoreCase("stop"))
              System.out.println("Total Number of Lines: " + LOC(input) + "\n" + Method(input) + "\n" + Type(input));
              System.out.print("\nEnter file name to search again or \"stop\" to terminate the program: ");
              input = userInput.readLine();
    public static int LOC(String inputFile) throws IOException, FileNotFoundException
         int numLines = 0;
         try
                        FileReader FileIn = new FileReader(inputFile);
                        Scanner scanLines = new Scanner (FileIn);
                        String line;
                             while (scanLines.hasNext())
                                  line = scanLines.nextLine();
                                  if (line.startsWith("/*"))
                                       numLines--;
                                  else if(!line.equals(" "))
                                       numLines++;
                             FileIn.close();
              catch(IOException IOE)
                   System.out.println("\nFile Not Found!");
                   return numLines;
    public static int MethodLOC(String inputFile) throws IOException, FileNotFoundException
         File FileIn = new File(inputFile);
         Scanner scanLines = new Scanner (FileIn);
         String line = null;
         int methodLOC = 0;
         while(scanLines.hasNext())
              line = scanLines.nextLine();
              if(!line.contains("/*"))
                   StringTokenizer st = new StringTokenizer(line, "\n");
                   methodLOC = st.countTokens();
         return methodLOC;
    public static String Method(String inputFile) throws IOException, FileNotFoundException
         String line = null;
         String name = null;
         String info = null;
         File FileIn = new File(inputFile);
         Scanner scanLines = new Scanner (FileIn);
         while(scanLines.hasNext())
              line = scanLines.nextLine();
         if(line.contains("METHOD"))
              StringTokenizer st = new StringTokenizer(line, " ");
              String proxy = st.nextToken();
              String method = st.nextToken();
              name = st.nextToken();
              info = "Name of Method: " + name;
    return info;
    public static String Type(String inputFile) throws IOException, FileNotFoundException
         String line = null;
         String name = null;
         String info = null;
         String count = null;
         File FileIn = new File(inputFile);
         Scanner scanLines = new Scanner (FileIn);
         while(scanLines.hasNext())
         if(line.contains("PROXY"))
              StringTokenizer st = new StringTokenizer(line, " ");
              String proxy = st.nextToken();
              String method = st.nextToken();
              name = st.nextToken();
              String type = st.nextToken();
              info = "Name of Proxy: " + name + "\n" + "Type of Proxy: " + type;
         count = info;
    return count;
    }

    Iterate through the lines and count the opening and closing curly braces. Whenever you see an opening one, increase the counter, when you see a closing one, decrease the counter. When the counter hits 0 again, you reached the end of the method.
    I assume you know how to count lines while moving through a text line by line.

  • Fastest way to count the number of occurences of string in file

    I have an application that will process a number of records in a plain text file, and the processing takes a long time. Therefore, I'd like to first calculate the number of records in the file so that I can display a progress dialog to the user (e.g. " 1234 out of 5678 records processed"). The records are separated by the string "//" followed by a newline, so all I need to do to get the number of records is to count the number of times that '//' occurs in the file. What's the quickest way to do this? On a test file of ~1.5 Gb with ~500 000 records, grep manages under 5 seconds, whereas a naive Java approach:
    BufferedReader bout = new BufferedReader (new FileReader (sourcefile));
                   String ffline = null;
                   int lcnt = 0;
                   int searchCount = 0;
                   while ((ffline = bout.readLine()) != null) {
                        lcnt++;
                        for(int searchIndex=0;searchIndex<ffline.length();) {
                             int index=ffline.indexOf(searchFor,searchIndex);
                             if(index!=-1) {
                                  //System.out.println("Line number " + lcnt);
                                  searchCount++;
                                  searchIndex+=index+searchLength;
                             } else {
                                  break;
                   }takes about 10 times as long:
    martin@martin-laptop:~$ time grep -c '//' Desktop/moresequences.gb
    544064
    real     0m4.449s
    user     0m3.880s
    sys     0m0.544s
    martin@martin-laptop:~$ time java WordCounter Desktop/moresequences.gb
    SearchCount = 544064
    real     0m42.719s
    user     0m40.843s
    sys     0m1.232sI suspect that dealing with the file as a whole, rather than line-by-line, might be quicker, based on previous experience with Perl.

    Reading lines is very slow. If your file has single byte character encoding then use something like the KMP algorithm on an BufferedInputStream to find the byte sequence of "//\n".getBytes(). If the file has a multi-byte encoding then use the KMP algorithm on a BufferedReader to find the chars "//\n".getCharacters() .
    The basis for this can be found in reply #12 of http://forum.java.sun.com/thread.jspa?threadID=769325&messageID=4386201 .
    Edited by: sabre150 on May 2, 2008 2:10 PM

  • Have EEM count the number of Lines

    In *nix this is as simple as "wc -l" but unfortunately I can't seem to find a simple solution.  For the purposes of this thread here is my test script...
    event manager applet TEST authorization bypass
    event syslog pattern "TRIGGER"
    action 1.0 cli command "enable"
    action 2.0 cli command "conf t"
    action 3.0 cli command "show log"
    action 4.0 cli command "COUNT NUMBER OF LINES FROM SHOW LOG -- $_cli_result"
    Can someone let me know what action 4.0 would be in order to complete this task?
    Thanks!

    Actually, that parially worked.  Perhaps you can help me troubleshoot the results I am getting. 
    Here is my test script:
    edge2821a#show run | sec eventevent manager applet TEST authorization bypass event none action 1.0 cli command "enable" action 2.0 cli command "conf t" action 3.0 cli command "show ip nat trans" action 4.0 set LINES "0" action 4.1 foreach line "$_cli_result" "\n" action 4.2  increment LINES action 4.3 end action 4.4 puts "Number of NAT Translations: $LINES"
    Here is my actual NAT translation table:
    edge2821a#show ip nat translationsPro Inside global      Inside local       Outside local      Outside globaludp 72.68.68.238:123   10.0.10.200:123    66.27.60.10:123    66.27.60.10:123tcp 72.68.68.238:4030  10.0.20.100:4030   ---                ---tcp 72.68.68.238:4031  10.0.20.100:4031   ---                ---tcp 72.68.68.238:23    10.0.20.105:22     ---                ---tcp 72.68.68.238:80    10.0.20.105:80     199.248.199.110:59691 199.248.199.110:59691tcp 72.68.68.238:80    10.0.20.105:80     ---                ---tcp 72.68.68.238:9090  10.0.20.201:8080   ---                ---tcp 72.68.68.238:443   10.0.20.225:80     ---                ---tcp 72.68.68.238:9022  10.0.21.230:22     173.70.201.69:49353 173.70.201.69:49353tcp 72.68.68.238:9022  10.0.21.230:22     ---                ---udp 72.68.68.238:50817 10.0.21.231:50817  63.142.161.5:3997  63.142.161.5:3997udp 72.68.68.238:55703 10.0.21.231:55703  63.142.161.5:1194  63.142.161.5:1194udp 72.68.68.238:49917 10.0.30.30:49917   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:50011 10.0.30.30:50011   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:51973 10.0.30.30:51973   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:56512 10.0.30.30:56512   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:56639 10.0.30.30:56639   71.250.0.12:53     71.250.0.12:53tcp 72.68.68.238:57373 10.0.30.30:57373   64.12.24.171:443   64.12.24.171:443tcp 72.68.68.238:57404 10.0.30.30:57404   173.194.73.125:5222 173.194.73.125:5222Pro Inside global      Inside local       Outside local      Outside globaltcp 72.68.68.238:57412 10.0.30.30:57412   173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:57413 10.0.30.30:57413   173.194.68.109:587 173.194.68.109:587tcp 72.68.68.238:57414 10.0.30.30:57414   173.194.68.109:465 173.194.68.109:465udp 72.68.68.238:57572 10.0.30.30:57572   71.250.0.12:53     71.250.0.12:53tcp 72.68.68.238:60348 10.0.30.30:60348   173.194.76.108:993 173.194.76.108:993udp 72.68.68.238:60413 10.0.30.30:60413   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:61461 10.0.30.30:61461   71.250.0.12:53     71.250.0.12:53tcp 72.68.68.238:61632 10.0.30.30:61632   17.149.36.76:5223  17.149.36.76:5223udp 72.68.68.238:62019 10.0.30.30:62019   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:63756 10.0.30.30:63756   71.250.0.12:53     71.250.0.12:53udp 72.68.68.238:65134 10.0.30.30:65134   71.250.0.12:53     71.250.0.12:53tcp 72.68.68.238:65188 10.0.30.30:65188   173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:65274 10.0.30.30:65274   173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:65310 10.0.30.30:65310   173.194.76.108:993 173.194.76.108:993tcp 72.68.68.238:65311 10.0.30.30:65311   173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:65312 10.0.30.30:65312   173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:65374 10.0.30.30:65374   173.194.76.108:993 173.194.76.108:993tcp 72.68.68.238:65429 10.0.30.30:65429   173.194.74.109:993 173.194.74.109:993tcp 72.68.68.238:65466 10.0.30.30:65466   74.125.226.195:80  74.125.226.195:80tcp 72.68.68.238:65467 10.0.30.30:65467   74.125.226.200:80  74.125.226.200:80tcp 72.68.68.238:65469 10.0.30.30:65469   173.194.43.7:443   173.194.43.7:443tcp 72.68.68.238:65470 10.0.30.30:65470   173.194.43.7:443   173.194.43.7:443tcp 72.68.68.238:65471 10.0.30.30:65471   173.194.43.7:443   173.194.43.7:443Pro Inside global      Inside local       Outside local      Outside globaltcp 72.68.68.238:65472 10.0.30.30:65472   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65473 10.0.30.30:65473   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65474 10.0.30.30:65474   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65475 10.0.30.30:65475   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65476 10.0.30.30:65476   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65477 10.0.30.30:65477   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65478 10.0.30.30:65478   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65479 10.0.30.30:65479   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65480 10.0.30.30:65480   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65481 10.0.30.30:65481   173.194.75.99:443  173.194.75.99:443tcp 72.68.68.238:65482 10.0.30.30:65482   192.168.1.1:2555   192.168.1.1:2555tcp 72.68.68.238:65484 10.0.30.30:65484   206.46.232.12:465  206.46.232.12:465tcp 72.68.68.238:65485 10.0.30.30:65485   173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:65486 10.0.30.30:65486   173.194.68.109:465 173.194.68.109:465tcp 72.68.68.238:65487 10.0.30.30:65487   173.194.68.109:587 173.194.68.109:587tcp 72.68.68.238:52115 10.0.30.60:52115   204.8.241.230:443  204.8.241.230:443tcp 72.68.68.238:52523 10.0.30.60:52523   204.8.241.230:443  204.8.241.230:443tcp 72.68.68.238:52524 10.0.30.60:52524   204.8.241.230:443  204.8.241.230:443tcp 72.68.68.238:52525 10.0.30.60:52525   204.8.241.230:443  204.8.241.230:443tcp 72.68.68.238:52571 10.0.30.60:52571   17.172.232.217:5223 17.172.232.217:5223tcp 72.68.68.238:52861 10.0.30.60:52861   173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:53667 10.0.30.60:53667   204.8.241.230:443  204.8.241.230:443Pro Inside global      Inside local       Outside local      Outside globaltcp 72.68.68.238:53668 10.0.30.60:53668   173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:50519 10.0.30.62:50519   69.171.230.22:443  69.171.230.22:443tcp 72.68.68.238:50597 10.0.30.62:50597   17.149.36.120:443  17.149.36.120:443tcp 72.68.68.238:50889 10.0.30.62:50889   173.252.103.48:443 173.252.103.48:443tcp 72.68.68.238:51959 10.0.30.62:51959   23.67.251.64:80    23.67.251.64:80tcp 72.68.68.238:52085 10.0.30.62:52085   69.171.233.33:443  69.171.233.33:443tcp 72.68.68.238:52091 10.0.30.62:52091   17.149.36.162:443  17.149.36.162:443tcp 72.68.68.238:52216 10.0.30.62:52216   17.172.233.111:443 17.172.233.111:443tcp 72.68.68.238:53102 10.0.30.206:53102  184.51.206.137:80  184.51.206.137:80tcp 72.68.68.238:52958 10.0.30.233:52958  173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:52959 10.0.30.233:52959  173.194.68.109:993 173.194.68.109:993tcp 72.68.68.238:52961 10.0.30.233:52961  173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:52962 10.0.30.233:52962  173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:59069 10.0.30.233:59069  17.158.10.36:443   17.158.10.36:443tcp 72.68.68.238:59070 10.0.30.233:59070  17.158.10.36:443   17.158.10.36:443tcp 72.68.68.238:59072 10.0.30.233:59072  74.125.226.233:443 74.125.226.233:443tcp 72.68.68.238:65140 10.0.30.233:65140  173.194.73.125:5222 173.194.73.125:5222tcp 72.68.68.238:53041 10.0.30.234:53041  173.194.68.108:993 173.194.68.108:993tcp 72.68.68.238:53250 10.0.30.234:53250  173.194.74.108:993 173.194.74.108:993tcp 72.68.68.238:53520 10.0.30.234:53520  17.172.232.158:443 17.172.232.158:443tcp 72.68.68.238:54172 10.0.30.235:54172  17.149.36.165:5223 17.149.36.165:5223tcp 72.68.68.238:54173 10.0.30.235:54173  17.172.238.204:443 17.172.238.204:443Pro Inside global      Inside local       Outside local      Outside globaltcp 72.68.68.238:55523 10.0.30.235:55523  173.194.76.108:993 173.194.76.108:993
    Here is the output of my EEM script:
    edge2821a#event manager run TESTNumber of NAT Translations: 4
    The value of $LINES shoudl have been 92, not 4.  Can you help me to identify the problem?
    Thanks!

  • Count the number of lines in all of my java files.

    I have created a reasonable size project with about 20 classes, rather than going through each and counting the lines are their any programs maby integrated into forte or another ide which can do this?
    Thanks

    Actually, if you are looking for kloc statitics, it is more complicated. You would not want blank lines counted. You may also want to separate out the counts for comments vs. code. Also seprations between JavaDoc comments and commented-out code. There are free and commercial programs which do this, or you can write your own.

  • How to Count the number of TAB chars value '0A' in a line?

    I have a requirement to count the number of TABs in a text file that I am processing (they must equal 75) to ensure that all the fields have been submitted on the file I am reading?
    How do I identify the TABs in a line?
    I have this so far:
             CONCATENATE gv_unix_file gv_lstfiles-name INTO gv_unix_file.
              OPEN DATASET gv_unix_file for INPUT IN TEXT MODE ENCODING NON-UNICODE.
              IF sy-subrc <> 0 .
                message e000(zz) with 'Cannot access in_uk files'.
              ENDIF.
              CONCATENATE gv_unix_file_arc gv_lstfiles-name INTO gv_unix_file_arc.
              OPEN DATASET gv_unix_file_arc FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
              IF sy-subrc <> 0 .
                message e000(zz) with 'Cannot access in_uk files'.
              ENDIF.
              DO.
                READ DATASET gv_unix_file into lv_str.
                IF sy-subrc <> 0.
                  exit. "exit do loop, file is done.
                else.
                  TRANSFER lv_str to gv_unix_file_arc.
                ENDIF.
              ENDDO.

    Here is a sample code:
    DATA: lv_string TYPE string,
          lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          lv_i TYPE i.
    DATA: result_tab TYPE match_result_tab.
    DO 3 TIMES.
      CONCATENATE 'A' lv_string INTO lv_string SEPARATED BY lv_tab.
    ENDDO.
    " this is how you need to find how many tabs are in your transfer work area...
    FIND ALL OCCURRENCES OF lv_tab IN lv_string RESULTS result_tab.
    DESCRIBE TABLE result_tab LINES lv_i.
    WRITE:'No. of tabs found:', lv_i.

  • How can i read the number of lines written - in spreadshee​t array?

    hello NI,
                           I am writing file as spreadsheet format continuously, contains date, time, chanel1, channel 2, channel 3..... etc.
    i just want to know how many lines has been written after file write....
    Regards,
    Balaji DP

    You count the number of line termination char. Se example 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    sample.PNG ‏25 KB

Maybe you are looking for

  • BUG in SelectBooleanCheckBox component binding Simple Use Case

    I have a table called Customer have four fields. Id, Name, Gender, Regular. The sample data is --- 23, Mark, M, Y --- 26, Fiona, F, N I want to show an updatable form to the end user for the same using ADF. The UI components for Name, Gender are Outp

  • Dimension Table contents are different after cube copy - why?

    To all, I'm doing some work on a cube based on some bad dimensioning in it's original design.  We're running BI 3.50 - The original cube is INV_C01 - here is the table contents based upon SAP_INFOCUBE_DESIGNS report - INV_C01            rows:    243,

  • Installed CS5 after CS5.5. How do I fix associations?

    I installed CS5.5 Master which includes PRemiere and After Effects onto a brand new PC I built. I though I knew that I'd never need my copy of CS5 MC again so I didn't even load it. Then I realized I have several plug-ins that will not install in CS5

  • Play input data in serial connection in speakers ?

    Hi. I want to play input data with system speakers. Data receive from Serial Port and I want to play it realtime. my data frequency rabge is between 10 to 500 and it;s amplitude is up to 1. I use this Subvi that I right it for put in final Vi.  Sampl

  • Oracle send email if error, is it possible?

    How to make the oracle send email to the administrator every time it comes up error? I Use Oracle 10g...