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

Author Topic: Assigned for Awk in another Section  (Read 15218 times)

0 Members and 1 Guest are viewing this topic.

BillRichardson

    Topic Starter


    Intermediate

    Thanked: 15
    Re: Assigned for Awk in another Section
    « Reply #15 on: December 26, 2009, 01:57:44 AM »
    so which post number is it ? all i can see is you have a lot of disparate batch files like awkbat6, awkbat8 etc ...can you combine the full solution into 1 batch file ??

    Ghostdog74  or  BC  are welcome to offer their own Batch solution.
    Bill Richardson

    ghostdog74



      Specialist

      Thanked: 27
      Re: Assigned for Awk in another Section
      « Reply #16 on: December 26, 2009, 02:06:58 AM »
      Ghostdog74  or  BC  are welcome to offer their own Batch solution.
      you are not answering my question. I am very interested in your batch solution, but you make it so hard to decipher which ones your final solutions are. I am merely asking you to reorganise your batches into 1 batch file. If you have done it, then which one is the actual one? post number 1??

      And for your information, i have already solved it with gawk. that's why i am interested when you post a batch solution to solve the same thing. If you are not going to reorganize your code, its fine with me. but you are not helping the others who see this post, that is your philosophy right?

      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: Assigned for Awk in another Section
      « Reply #17 on: December 26, 2009, 02:11:02 AM »
      Billrich is welcome to post a perl solution.

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

      BillRichardson

        Topic Starter


        Intermediate

        Thanked: 15
        Re: Assigned for Awk in another Section
        « Reply #18 on: December 26, 2009, 02:19:58 AM »
        its from here

        I could find no feedback from Eldorado, Topic Starter,  that the Awk (gawk ?) solution worked for Eldorado?


        http://www.computerhope.com/forum/index.php/topic,97061.msg657265.html#msg657265

        Topic: Record Manipulation with AWK  (Read 306 times)

        Eldorado
        Topic Starter
        Bill Richardson

        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: Assigned for Awk in another Section
        « Reply #19 on: December 26, 2009, 02:29:19 AM »
        I could find no feedback from Eldorado, Topic Starter,  that the Awk (gawk ?) solution worked for Eldorado?

        Sometimes when a solution works you never hear from the OP again. gawk stands for GNU Awk, (or, I imagine that's what it stands for).

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

        ghostdog74



          Specialist

          Thanked: 27
          Re: Assigned for Awk in another Section
          « Reply #20 on: December 26, 2009, 02:31:59 AM »
          I could find no feedback from Eldorado, Topic Starter,  that the Awk (gawk ?) solution worked for Eldorado
          why does it matter? if it doesn't work, he will post back.
          and don't shift the subject focus. you provide a batch solution, but its all over the place. Can you put them into one batch file.? that's all i am asking. You can treat me as a beginner in batch and i am asking you a favor now to combine them to make it easier for me and others. how about that ?

          ghostdog74



            Specialist

            Thanked: 27
            Re: Assigned for Awk in another Section
            « Reply #21 on: December 26, 2009, 02:32:26 AM »
            gawk stands for GNU Awk, (or, I imagine that's what it stands for).
            yes.

            BillRichardson

              Topic Starter


              Intermediate

              Thanked: 15
              Re: Assigned for Awk in another Section
              « Reply #22 on: December 26, 2009, 02:33:20 AM »
              BillRichardson is welcome to post a perl solution.

              BC may offer his solution in "C", "Assembly", Perl or Machine Language . . .
              or any code at his command?

              I thought the Hope Board was designed for Batch?
              « Last Edit: December 27, 2009, 06:27:23 PM by BillRichardson »
              Bill Richardson

              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: Assigned for Awk in another Section
              « Reply #23 on: December 26, 2009, 02:45:01 AM »
              BC may offer his solution in "C", "Assembly", Pearl or Machine Language . . .
              or any code at his command?
              What the heck is Pearl? never heard of that language.

              Quote
              I thought the Hope Board was designed for Batch?
              Don't recall it ever saying that anywhere. the DOS board would, ideally, be for DOS batch files, you know, for DOS, not windows with command extensions. the only reason the DOS board is being used for Windows-based batches with command extensions is because otherwise they may as well remove it. maybe 1 in a thousand people are actually referring to a pure DOS batch. Because of that, and the fact that all versions of windows down to windows 98 natively support languages such as VBScript and jscript as the official scripting language of  the OS, any feasible solution is valid.

              If Ghostdog wants to post his solution in python, or awk, or what have you, then he's free to do so, especially when it solves the OP's problem. because, surprisingly, the OP most often doesn't really CARE what was used; as long as it solves the problem.
              I was trying to dereference Null Pointers before it was cool.

              BillRichardson

                Topic Starter


                Intermediate

                Thanked: 15
                Re: Assigned for Awk in another Section
                « Reply #24 on: December 27, 2009, 11:05:45 AM »
                All users of Windows have access  to Batch files. They can create and/or use Batch files.

                Only one person in 1000 have access to Awk (gawk ) files.  Only one person in 3000 know how to use use Awk files.
                Bill Richardson

                Salmon Trout

                • Guest
                Re: Assigned for Awk in another Section
                « Reply #25 on: December 27, 2009, 12:18:07 PM »
                Only one person in 3000 know how to use use Awk files.

                And it isn't you, by the look of things!

                ghostdog74



                  Specialist

                  Thanked: 27
                  Re: Assigned for Awk in another Section
                  « Reply #26 on: December 27, 2009, 04:45:30 PM »
                  All users of Windows have access  to Batch files. They can create and/or use Batch files.

                  Only one person in 1000 have access to Awk (gawk ) files.  Only one person in 3000 know how to use use Awk files.
                  i wish you could just stop babbling your nonsense and focus on what I, as a beginner in batch, wish you would do for me. Show me the final batch solution,  in one batch file.

                  BillRichardson

                    Topic Starter


                    Intermediate

                    Thanked: 15
                    Re: Assigned for Awk in another Section
                    « Reply #27 on: December 27, 2009, 06:22:50 PM »
                    I look forward to your final result.

                    See  awkbatfinal.bat in the opening post of this thread.

                    There is only one main batch.  The main batch calls awkbat6.bat  and awkbat8.bat for lines 306 and 308.
                    Bill Richardson

                    eldorado



                      Greenhorn

                      Re: Assigned for Awk in another Section
                      « Reply #28 on: December 27, 2009, 07:01:22 PM »
                      Code: [Select]
                      awk -F"|" '{
                          a[$1]=a[$1] FS $2 FS $3
                      }
                      END{
                          for(i in a){
                              print i,a[i]
                          }
                      }' file


                      output
                      Code: [Select]
                      $ ./shell.sh
                      301 |AF_ACC_BDL|774;|AF_WMG_BDL|6660;|AF_REP_BDL|4735;
                      303 |AF_ACC_BDL|1360;
                      304 |AF_ACC_BDL|5092;
                      305 |AF_ACC_BDL|32384;
                      306 |AF_ACC_BDL|80859;|AF_REP_BDL|80875;
                      308 |AF_ACC_BDL|1418;|AF_WLH_BDL|78273;|AF_WSL_BDL|9990;|AF_WFL_BDL|9998;


                      Hi ghostdog74,

                      The solution you provided works perfectly. Thanks alot!  :)

                      ghostdog74



                        Specialist

                        Thanked: 27
                        Re: Assigned for Awk in another Section
                        « Reply #29 on: December 27, 2009, 07:13:53 PM »
                        See  awkbatfinal.bat in the first post of this thread.
                        ok, i seen your code, but i wonder where are awkbat6.bat and awkbat8.bat ?? I have also run your code, but i have another question, if i have more data, like 309, 310, 311 etc...do i have to create awkbat09.bat , awkbat10.bat, awkbat11.bat etc as well??