Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to get the Count of string in file  (Read 36576 times)

0 Members and 1 Guest are viewing this topic.

victoria



    Beginner

    Thanked: 1
    Re: how to get the Count of string in file
    « Reply #15 on: August 08, 2010, 04:51:04 PM »
    Victoria, I really do not understand what these commands will do.

    Seems like not a proper bat file.

    It is a VBS written by Sidewinder in Reply #6.  It works perfectly.

    I do not write VBS.

    Many ways to skin a cat.

    Have a Nice Day

    victoria



      Beginner

      Thanked: 1
      How to get the Count of string in file
      « Reply #16 on: August 09, 2010, 05:18:13 AM »
      I use a Proxy Server to reach Computer Hope.  The Editor used to post this post  does not work well.   I get random extra \\.  There  was only one \\ each time here.

      Nevertheless,  the string count by me and sidewinder is the same.

      Please do not question my sanity.

      Have a Nice Day

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: How to get the Count of string in file
      « Reply #17 on: August 09, 2010, 05:43:28 AM »
      I use a Proxy Server to reach Computer Hope. 

      We know.
      I was trying to dereference Null Pointers before it was cool.

      arunavlp

        Topic Starter


        Greenhorn

        Re: how to get the Count of string in file
        « Reply #18 on: August 09, 2010, 05:52:52 AM »
        hi,

        It got Worked Thanks. Smart Work.


        Regards,
        Arun S.

        victoria



          Beginner

          Thanked: 1
          Re: How to get the Count of string in file
          « Reply #19 on: August 09, 2010, 05:55:41 AM »
          We know.

          How do I avoid random \\ when I post?
          Have a Nice Day

          kpac

          • Web moderator


          • Hacker

          • kpac®
          • Thanked: 184
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 7
          Re: how to get the Count of string in file
          « Reply #20 on: August 09, 2010, 10:35:04 AM »
          victoria...just wondering, what's the proxy server's IP?

          victoria



            Beginner

            Thanked: 1
            Re: how to get the Count of string in file
            « Reply #21 on: August 09, 2010, 11:54:11 AM »
            victoria...just wondering, what is  the proxy server IP?

            ????

            The Ip address is dynamic and several Proxy Servers rotate the IP address?

            Not really sure?
            Have a Nice Day

            vishuvishal



              Beginner
            • Thanked: 3
              Re: how to get the Count of string in file
              « Reply #22 on: August 09, 2010, 02:04:30 PM »
              We can do this using DOS also

              Please run this in loop. Once please enter the condition once we get EOF. like '\0' or null or " " etc. I do not know exactly what to use for batch.

              Please complete or correct my codes.
              Code: [Select]
              set /p pass=<string.txt
              echo %pass%
              :st
              call set new=%%pass:~%a%,1%%
              echo a=%a% + 1
              echo %a%

              Thanks and regards
              vishu

              victoria



                Beginner

                Thanked: 1
                Re: how to get the Count of string in file
                « Reply #23 on: August 09, 2010, 08:19:40 PM »

                Please complete or correct my codes.
                Code: [Select]
                set /p pass=<string.txt
                echo %pass%
                :st
                call set new=%%pass:~%a%,1%%
                echo a=%a% + 1
                echo %a%


                Have a Nice Day

                victoria



                  Beginner

                  Thanked: 1
                  Re: how to get the Count of string in file
                  « Reply #24 on: August 09, 2010, 08:21:49 PM »
                  To Vis,


                  Have a Nice Day

                  victoria



                    Beginner

                    Thanked: 1
                    How to get the Count of string in file
                    « Reply #25 on: August 10, 2010, 05:25:58 PM »
                    Hello.  Wrong Thread.
                    Have a Nice Day

                    victoria



                      Beginner

                      Thanked: 1
                      Re: how to get the Count of string in file
                      « Reply #26 on: August 11, 2010, 08:04:58 PM »
                      We can do this using DOS also

                      Please run this in loop. Once please enter the condition once we get EOF. like 01\'0\' or null or \" \" etc. I do not know exactly what to use for batch.

                      Please complete or correct my codes.
                      Code: [Select]
                      set /p pass=<string.txt
                      echo %pass%
                      :st
                      call set new=%%pass:~%a%,1%%
                      echo a=%a% + 1
                      echo %a%

                      Thanks and regards
                      vishu

                      C:test>type viscnt.bat
                      @echo off
                      set /a a=2
                      echo Here is a string > string.txt
                      set /p pass=<string.txt
                      echo pass=%pass%
                      REM :st is label or a point in the code
                      REM where we jump to or return to

                      call :st %a%
                      echo  return from :st

                      rem we may use call to jump to or return to a location
                      rem ( a label ) in the code or to rem another batch file

                      rem set new=%%pass:~%a%,1%%  I do not  know what this does
                      set new=%pass:~%a%,1%
                      echo new=%new%
                      rem set assigns a value to a variable.
                      rem A variable is a location in RAM where the value is stored
                      set /a a=%a% + 1
                      echo a=%a%
                      goto :end
                      :st %a%
                      echo a=%1
                      echo We are at  the  :st label location
                      echo a=%1
                      exit /b
                      :end

                      Output:

                      C:test>viscnt.bat
                      pass=Here is a string
                      a=2
                      We are at  the  :st label location
                      a=2
                       return from :st
                      new=Here is a string a
                      a=3

                      Have a Nice Day

                      Salmon Trout

                      • Guest
                      Re: How to get the Count of string in file
                      « Reply #27 on: August 12, 2010, 12:39:00 AM »
                      Hello.  Wrong Thread.

                      Getting confused, Bill?  :)

                      victoria



                        Beginner

                        Thanked: 1
                        How to get the Count of string in file
                        « Reply #28 on: August 12, 2010, 02:23:56 AM »
                        Say What?
                        Have a Nice Day

                        Salmon Trout

                        • Guest
                        Re: How to get the Count of string in file
                        « Reply #29 on: August 12, 2010, 09:07:15 AM »