Loading ...
Sorry, an error occurred while loading the content.

soalan sed ngan regexp

Expand Messages
  • md_najmi
    salam, kalo ade file ade bende nih; @article{Choi, title = A static API birthmark for Windows binary executables , journal = Journal of Systems and
    Message 1 of 11 , Mar 3, 2010
    • 0 Attachment
      salam,

      kalo ade file ade bende nih;

      @article{Choi,
      title = "A static API birthmark for Windows binary executables",
      journal = "Journal of Systems and Software",
      volume = "82",
      number = "5",
      pages = "862 - 873",
      year = "2009",
      note = "",
      issn = "0164-1212",
      doi = "DOI: 10.1016/j.jss.2008.11.848",
      url = "http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681",
      author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
      keywords = "Software birthmark",
      keywords = "Software theft detection",
      keywords = "Software security",
      keywords = "Static analysis",
      keywords = "Reverse engineering"
      }

      nak tukor " " kepada { }.. ape care lagi elegan selain;

      sed 's/\ =\ \"/\ = \{/g' test > out
      's/\",/\},/g' out > last
      vi last (huruf last takle tukor... ngelat)
    • Toriq Zainuddin
      sed s/^ (.* ) = (.* ) ,$/ 1 = { 2 }/ test ... [Non-text portions of this message have been removed]
      Message 2 of 11 , Mar 3, 2010
      • 0 Attachment
        sed "s/^\(.*\) = \"\(.*\)\",$/\1 = \{\2\}/" test

        On Wed, Mar 3, 2010 at 11:27 PM, md_najmi <md_najmi@...> wrote:

        >
        >
        > salam,
        >
        > kalo ade file ade bende nih;
        >
        > @article{Choi,
        > title = "A static API birthmark for Windows binary executables",
        > journal = "Journal of Systems and Software",
        > volume = "82",
        > number = "5",
        > pages = "862 - 873",
        > year = "2009",
        > note = "",
        > issn = "0164-1212",
        > doi = "DOI: 10.1016/j.jss.2008.11.848",
        > url = "
        > http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681
        > ",
        > author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
        > keywords = "Software birthmark",
        > keywords = "Software theft detection",
        > keywords = "Software security",
        > keywords = "Static analysis",
        > keywords = "Reverse engineering"
        > }
        >
        > nak tukor " " kepada { }.. ape care lagi elegan selain;
        >
        > sed 's/\ =\ \"/\ = \{/g' test > out
        > 's/\",/\},/g' out > last
        > vi last (huruf last takle tukor... ngelat)
        >
        >
        >


        [Non-text portions of this message have been removed]
      • yon
        salam, cuba sed jugak dgn s@ = ([^ ]*) @ = ( 0 )@g ... [Non-text portions of this message have been removed]
        Message 3 of 11 , Mar 3, 2010
        • 0 Attachment
          salam,

          cuba sed jugak dgn 's@\ =\ "([^"]*)"@\ =\ \(\0\)@g'


          On 3 March 2010 23:27, md_najmi <md_najmi@...> wrote:

          >
          >
          > salam,
          >
          > kalo ade file ade bende nih;
          >
          > @article{Choi,
          > title = "A static API birthmark for Windows binary executables",
          > journal = "Journal of Systems and Software",
          > volume = "82",
          > number = "5",
          > pages = "862 - 873",
          > year = "2009",
          > note = "",
          > issn = "0164-1212",
          > doi = "DOI: 10.1016/j.jss.2008.11.848",
          > url = "
          > http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681
          > ",
          > author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
          > keywords = "Software birthmark",
          > keywords = "Software theft detection",
          > keywords = "Software security",
          > keywords = "Static analysis",
          > keywords = "Reverse engineering"
          > }
          >
          > nak tukor " " kepada { }.. ape care lagi elegan selain;
          >
          > sed 's/\ =\ \"/\ = \{/g' test > out
          > 's/\",/\},/g' out > last
          > vi last (huruf last takle tukor... ngelat)
          >
          >
          >


          [Non-text portions of this message have been removed]
        • Toriq Zainuddin
          sorry.. to handle the last line wout the , sed s/^ (.* ) = (.* ) ,*$/ 1 = { 2 }/ ... [Non-text portions of this message have been removed]
          Message 4 of 11 , Mar 3, 2010
          • 0 Attachment
            sorry.. to handle the last line wout the ','
            sed "s/^\(.*\) = \"\(.*\)\",*$/\1 = \{\2\}/"

            On Thu, Mar 4, 2010 at 10:32 AM, Toriq Zainuddin <toriqz@...> wrote:

            > sed "s/^\(.*\) = \"\(.*\)\",$/\1 = \{\2\}/" test
            >
            >
            > On Wed, Mar 3, 2010 at 11:27 PM, md_najmi <md_najmi@...> wrote:
            >
            >>
            >>
            >> salam,
            >>
            >> kalo ade file ade bende nih;
            >>
            >> @article{Choi,
            >> title = "A static API birthmark for Windows binary executables",
            >> journal = "Journal of Systems and Software",
            >> volume = "82",
            >> number = "5",
            >> pages = "862 - 873",
            >> year = "2009",
            >> note = "",
            >> issn = "0164-1212",
            >> doi = "DOI: 10.1016/j.jss.2008.11.848",
            >> url = "
            >> http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681
            >> ",
            >> author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
            >> keywords = "Software birthmark",
            >> keywords = "Software theft detection",
            >> keywords = "Software security",
            >> keywords = "Static analysis",
            >> keywords = "Reverse engineering"
            >> }
            >>
            >> nak tukor " " kepada { }.. ape care lagi elegan selain;
            >>
            >> sed 's/\ =\ \"/\ = \{/g' test > out
            >> 's/\",/\},/g' out > last
            >> vi last (huruf last takle tukor... ngelat)
            >>
            >>
            >>
            >
            >


            [Non-text portions of this message have been removed]
          • md_najmi
            bro, aku try oneliner hang ni, URL dia tetap dabel quotes jugak.
            Message 5 of 11 , Mar 3, 2010
            • 0 Attachment
              bro, aku try oneliner hang ni, URL dia tetap dabel quotes jugak.

              --- In mypenguin99@yahoogroups.com, Toriq Zainuddin <toriqz@...> wrote:
              >
              > sorry.. to handle the last line wout the ','
              > sed "s/^\(.*\) = \"\(.*\)\",*$/\1 = \{\2\}/"
              >
              > On Thu, Mar 4, 2010 at 10:32 AM, Toriq Zainuddin <toriqz@...> wrote:
              >
              > > sed "s/^\(.*\) = \"\(.*\)\",$/\1 = \{\2\}/" test
              > >
              > >
              > > On Wed, Mar 3, 2010 at 11:27 PM, md_najmi <md_najmi@...> wrote:
              > >
              > >>
              > >>
              > >> salam,
              > >>
              > >> kalo ade file ade bende nih;
              > >>
              > >> @article{Choi,
              > >> title = "A static API birthmark for Windows binary executables",
              > >> journal = "Journal of Systems and Software",
              > >> volume = "82",
              > >> number = "5",
              > >> pages = "862 - 873",
              > >> year = "2009",
              > >> note = "",
              > >> issn = "0164-1212",
              > >> doi = "DOI: 10.1016/j.jss.2008.11.848",
              > >> url = "
              > >> http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681
              > >> ",
              > >> author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
              > >> keywords = "Software birthmark",
              > >> keywords = "Software theft detection",
              > >> keywords = "Software security",
              > >> keywords = "Static analysis",
              > >> keywords = "Reverse engineering"
              > >> }
              > >>
              > >> nak tukor " " kepada { }.. ape care lagi elegan selain;
              > >>
              > >> sed 's/\ =\ \"/\ = \{/g' test > out
              > >> 's/\",/\},/g' out > last
              > >> vi last (huruf last takle tukor... ngelat)
              > >>
              > >>
              > >>
              > >
              > >
              >
              >
              > [Non-text portions of this message have been removed]
              >
            • md_najmi
              yg ni tak jalan bro. lagi satu { } dalam parameter hang tak boh..
              Message 6 of 11 , Mar 3, 2010
              • 0 Attachment
                yg ni tak jalan bro. lagi satu { } dalam parameter hang tak boh..


                --- In mypenguin99@yahoogroups.com, yon <y0n1sm3@...> wrote:
                >
                > salam,
                >
                > cuba sed jugak dgn 's@\ =\ "([^"]*)"@\ =\ \(\0\)@g'
                >
                >
                > On 3 March 2010 23:27, md_najmi <md_najmi@...> wrote:
                >
                > >
                > >
                > > salam,
                > >
                > > kalo ade file ade bende nih;
                > >
                > > @article{Choi,
                > > title = "A static API birthmark for Windows binary executables",
                > > journal = "Journal of Systems and Software",
                > > volume = "82",
                > > number = "5",
                > > pages = "862 - 873",
                > > year = "2009",
                > > note = "",
                > > issn = "0164-1212",
                > > doi = "DOI: 10.1016/j.jss.2008.11.848",
                > > url = "
                > > http://www.sciencedirect.com/science/article/B6V0N-4V42J3J-1/2/7e56d526e5a68cb31bae880498cb6681
                > > ",
                > > author = "Seokwoo Choi and Heewan Park and Hyun-il Lim and Taisook Han",
                > > keywords = "Software birthmark",
                > > keywords = "Software theft detection",
                > > keywords = "Software security",
                > > keywords = "Static analysis",
                > > keywords = "Reverse engineering"
                > > }
                > >
                > > nak tukor " " kepada { }.. ape care lagi elegan selain;
                > >
                > > sed 's/\ =\ \"/\ = \{/g' test > out
                > > 's/\",/\},/g' out > last
                > > vi last (huruf last takle tukor... ngelat)
                > >
                > >
                > >
                >
                >
                > [Non-text portions of this message have been removed]
                >
              • Istas F. Nusyirwan
                cat bibtex.bib | sed s/ ,/ },/g | sed s/ / {/g | sed s/ $/ }/g -- Istas F. Nusyirwan [Non-text portions of this message have been removed]
                Message 7 of 11 , Mar 3, 2010
                • 0 Attachment
                  cat bibtex.bib | sed 's/\",/\},/g' | sed 's/ \"/ \{/g' | sed 's/\"$/\}/g'

                  --
                  Istas F. Nusyirwan


                  [Non-text portions of this message have been removed]
                • Mohammad Bahathir Hashim
                  s/ / {/; s/ / }/ Cuba terangkan kenapa ianya berjaya, dan apakah syarat supaya ianya berjaya. ... On Thu, Mar 4, 2010 at 12:19 PM, Istas F. Nusyirwan
                  Message 8 of 11 , Mar 3, 2010
                  • 0 Attachment
                    's/\"/\{/; s/\"/\}/'

                    Cuba terangkan kenapa ianya berjaya, dan apakah syarat supaya ianya berjaya.
                    :)







                    On Thu, Mar 4, 2010 at 12:19 PM, Istas F. Nusyirwan <
                    istasfahrurrazi@...> wrote:

                    > cat bibtex.bib | sed 's/\",/\},/g' | sed 's/ \"/ \{/g' | sed 's/\"$/\}/g'
                    >
                    > --
                    > Istas F. Nusyirwan
                    >
                    >
                    > [Non-text portions of this message have been removed]
                    >
                    >
                    >
                    > ------------------------------------
                    >
                    > Salam Aidilfitri kepada semua pelanggan mailing list my-penguin99.
                    >
                    >
                    > Untuk mengeluarkan diri anda dari senarai email ini, hantarkan email ke :
                    > mypenguin99-unsubscribe@yahoogroups.comYahoo! Groups Links
                    >
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • Istas F. Nusyirwan
                    2010/3/4 Mohammad Bahathir Hashim ... Baekk cikgu, 1. sed pertama tukar , kepada }, 2. sed kedua tukar kepada { 3. sed
                    Message 9 of 11 , Mar 3, 2010
                    • 0 Attachment
                      2010/3/4 Mohammad Bahathir Hashim <bahathir@...>

                      >
                      >
                      > 's/\"/\{/; s/\"/\}/'
                      >
                      > Cuba terangkan kenapa ianya berjaya, dan apakah syarat supaya ianya
                      > berjaya.
                      > :)
                      >
                      >
                      Baekk cikgu,

                      1. sed pertama tukar ", kepada },
                      2. sed kedua tukar <space>" kepada <space>{
                      3. sed ketiga tukar "<EOL> kepada }

                      Ia perlu dilakukan dengan turutan yang betul, kalau tak, tak jadi.

                      EOL - end of line

                      tu lah cadangan saya :)

                      --
                      Istas F. Nusyirwan


                      [Non-text portions of this message have been removed]
                    • Mohammad Bahathir Hashim
                      Markah 75% kerana kurang tepat 1) Untuk arahan s dalam sed, (subtitute), dan sekiranya tiada sebarang option di pengakhir araha... s/abc/123/ ; sed hanya
                      Message 10 of 11 , Mar 3, 2010
                      • 0 Attachment
                        Markah 75% kerana kurang tepat

                        1) Untuk arahan "s" dalam sed, (subtitute), dan sekiranya tiada sebarang
                        option di pengakhir araha... 's/abc/123/'; sed hanya akan tukar/replace
                        untuk satu occurrence yang pertama sekali sed jumpa pada BARISAN itu.

                        2) Jadi 's/\"/\}' akan tukar " yang pertama kepada } ... dan tidak akan cari
                        yang lain, sebab kita tidak letak option /g dibelakang arahan

                        3) Sed juga macan C atau shell juga, boleh mengabungkan beberapa arahan
                        dalam satu barisan... sebab itu saja larikan arahan sed kedua iaitu s/\"/\}/
                        untuk menggantikan " yang seeterusnya. pada BARISAN itu


                        4) sed 'arahan1; arahan2; ...' . Sed akan larikan arahan2 selepas arahan1
                        bermula dari permulaan BARISAN, dan seterusnya.


                        Sekrang.. apa syaratnya untuk ianya berjaya?

                        1) Kena ada 2 " dalam satu BARISAN yang sama...
                        2) Kalau tterdapat occurance melebih dari 2 " pada BARISAN yang sama,
                        seperti dibawah.

                        keywords = "Software birthmark", keywords = "Software theft detection"

                        Maka hanya 2 " yang pertama saja akan ditukarganti... Tapi jangan risau...
                        larikan saja sekali lagi... :)

                        Semoga dapat dikongsi bersama-sama.

                        2010/3/4 Istas F. Nusyirwan <istasfahrurrazi@...>

                        > 2010/3/4 Mohammad Bahathir Hashim <bahathir@...>
                        >
                        > >
                        > >
                        > > 's/\"/\{/; s/\"/\}/'
                        > >
                        > > Cuba terangkan kenapa ianya berjaya, dan apakah syarat supaya ianya
                        > > berjaya.
                        > > :)
                        > >
                        > >
                        > Baekk cikgu,
                        >
                        > 1. sed pertama tukar ", kepada },
                        > 2. sed kedua tukar <space>" kepada <space>{
                        > 3. sed ketiga tukar "<EOL> kepada }
                        >
                        > Ia perlu dilakukan dengan turutan yang betul, kalau tak, tak jadi.
                        >
                        > EOL - end of line
                        >
                        > tu lah cadangan saya :)
                        >
                        > --
                        > Istas F. Nusyirwan
                        >
                        >
                        > [Non-text portions of this message have been removed]
                        >
                        >
                        >
                        > ------------------------------------
                        >
                        > Salam Aidilfitri kepada semua pelanggan mailing list my-penguin99.
                        >
                        >
                        > Untuk mengeluarkan diri anda dari senarai email ini, hantarkan email ke :
                        > mypenguin99-unsubscribe@yahoogroups.comYahoo! Groups Links
                        >
                        >
                        >
                        >


                        [Non-text portions of this message have been removed]
                      • md_najmi
                        fuh, selama ni terperap dengan gaya s///g
                        Message 11 of 11 , Mar 3, 2010
                        • 0 Attachment
                          fuh, selama ni terperap dengan gaya 's///g'

                          --- In mypenguin99@yahoogroups.com, Mohammad Bahathir Hashim <bahathir@...> wrote:
                          >
                          > Markah 75% kerana kurang tepat
                          >
                          > 1) Untuk arahan "s" dalam sed, (subtitute), dan sekiranya tiada sebarang
                          > option di pengakhir araha... 's/abc/123/'; sed hanya akan tukar/replace
                          > untuk satu occurrence yang pertama sekali sed jumpa pada BARISAN itu.
                          >
                          > 2) Jadi 's/\"/\}' akan tukar " yang pertama kepada } ... dan tidak akan cari
                          > yang lain, sebab kita tidak letak option /g dibelakang arahan
                          >
                          > 3) Sed juga macan C atau shell juga, boleh mengabungkan beberapa arahan
                          > dalam satu barisan... sebab itu saja larikan arahan sed kedua iaitu s/\"/\}/
                          > untuk menggantikan " yang seeterusnya. pada BARISAN itu
                          >
                          >
                          > 4) sed 'arahan1; arahan2; ...' . Sed akan larikan arahan2 selepas arahan1
                          > bermula dari permulaan BARISAN, dan seterusnya.
                          >
                          >
                          > Sekrang.. apa syaratnya untuk ianya berjaya?
                          >
                          > 1) Kena ada 2 " dalam satu BARISAN yang sama...
                          > 2) Kalau tterdapat occurance melebih dari 2 " pada BARISAN yang sama,
                          > seperti dibawah.
                          >
                          > keywords = "Software birthmark", keywords = "Software theft detection"
                          >
                          > Maka hanya 2 " yang pertama saja akan ditukarganti... Tapi jangan risau...
                          > larikan saja sekali lagi... :)
                          >
                          > Semoga dapat dikongsi bersama-sama.
                          >
                          > 2010/3/4 Istas F. Nusyirwan <istasfahrurrazi@...>
                          >
                          > > 2010/3/4 Mohammad Bahathir Hashim <bahathir@...>
                          > >
                          > > >
                          > > >
                          > > > 's/\"/\{/; s/\"/\}/'
                          > > >
                          > > > Cuba terangkan kenapa ianya berjaya, dan apakah syarat supaya ianya
                          > > > berjaya.
                          > > > :)
                          > > >
                          > > >
                          > > Baekk cikgu,
                          > >
                          > > 1. sed pertama tukar ", kepada },
                          > > 2. sed kedua tukar <space>" kepada <space>{
                          > > 3. sed ketiga tukar "<EOL> kepada }
                          > >
                          > > Ia perlu dilakukan dengan turutan yang betul, kalau tak, tak jadi.
                          > >
                          > > EOL - end of line
                          > >
                          > > tu lah cadangan saya :)
                          > >
                          > > --
                          > > Istas F. Nusyirwan
                          > >
                          > >
                          > > [Non-text portions of this message have been removed]
                          > >
                          > >
                          > >
                          > > ------------------------------------
                          > >
                          > > Salam Aidilfitri kepada semua pelanggan mailing list my-penguin99.
                          > >
                          > >
                          > > Untuk mengeluarkan diri anda dari senarai email ini, hantarkan email ke :
                          > > mypenguin99-unsubscribe@...! Groups Links
                          > >
                          > >
                          > >
                          > >
                          >
                          >
                          > [Non-text portions of this message have been removed]
                          >
                        Your message has been successfully submitted and would be delivered to recipients shortly.