Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sscanf: parsing a file

sscanf: parsing a file

Scheduled Pinned Locked Moved C / C++ / MFC
questionregexjson
40 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T tom groezer

    Hi, I need to parse a file which has spaces and tabs with some entries that i need to pull. I'm using sscanf function. How do I ensure that I skip the spaces and tabs which could be in randon number. What could be a regular expression for this?

    CPalliniC Offline
    CPalliniC Offline
    CPallini
    wrote on last edited by
    #2

    Well, skipping blanks and tabs is very simple. You may code you own implementation for. :)

    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
    [My articles]

    In testa che avete, signor di Ceprano?

    T 1 Reply Last reply
    0
    • CPalliniC CPallini

      Well, skipping blanks and tabs is very simple. You may code you own implementation for. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      T Offline
      T Offline
      tom groezer
      wrote on last edited by
      #3

      I did not ask for simplicity or complexity but rather a solution.

      CPalliniC 1 Reply Last reply
      0
      • T tom groezer

        I did not ask for simplicity or complexity but rather a solution.

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #4

        The solution is in your hands (well in your brain). Write a function to skip balnks and tabs (you're supposed to be a software developer).

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        T 1 Reply Last reply
        0
        • CPalliniC CPallini

          The solution is in your hands (well in your brain). Write a function to skip balnks and tabs (you're supposed to be a software developer).

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          T Offline
          T Offline
          tom groezer
          wrote on last edited by
          #5

          I guess you are not a software developer but rather a philoshpher who thinks about those sentences. I need a urgent fix and dont want to travel googling. I guess the forum is to get answer and not to fight around and highjacking

          CPalliniC C T 3 Replies Last reply
          0
          • T tom groezer

            I guess you are not a software developer but rather a philoshpher who thinks about those sentences. I need a urgent fix and dont want to travel googling. I guess the forum is to get answer and not to fight around and highjacking

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #6

            tom groezer wrote:

            I guess you are not a software developer but rather a philoshpher who thinks about those sentences.

            Your guess is wrong: I'm actually a clown.

            tom groezer wrote:

            I need a urgent fix and dont want to travel googling.

            Do you really need google for that? Do you realize it is pretty basic stuff?

            tom groezer wrote:

            I guess the forum is to get answer and not to fight around and highjacking

            I suppose the forum should help, not give you code with a spoon.

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            In testa che avete, signor di Ceprano?

            T 1 Reply Last reply
            0
            • CPalliniC CPallini

              tom groezer wrote:

              I guess you are not a software developer but rather a philoshpher who thinks about those sentences.

              Your guess is wrong: I'm actually a clown.

              tom groezer wrote:

              I need a urgent fix and dont want to travel googling.

              Do you really need google for that? Do you realize it is pretty basic stuff?

              tom groezer wrote:

              I guess the forum is to get answer and not to fight around and highjacking

              I suppose the forum should help, not give you code with a spoon.

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              T Offline
              T Offline
              tom groezer
              wrote on last edited by
              #7

              R u a manager or something or r u not in your good MOODS. Get the crap out i will find it for myself : That will provide some breather to you. Have a nice evening :)

              CPalliniC 1 Reply Last reply
              0
              • T tom groezer

                R u a manager or something or r u not in your good MOODS. Get the crap out i will find it for myself : That will provide some breather to you. Have a nice evening :)

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #8

                tom groezer wrote:

                R u a manager or something or r u not in your good MOODS.

                Broken keyboard, eh? Well, sometimes I really would like to be a manager, you know, just to kick in the ass the lazy developers...

                tom groezer wrote:

                Have a nice evening

                Thanks (actually it's, morning here).

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                In testa che avete, signor di Ceprano?

                T 1 Reply Last reply
                0
                • CPalliniC CPallini

                  tom groezer wrote:

                  R u a manager or something or r u not in your good MOODS.

                  Broken keyboard, eh? Well, sometimes I really would like to be a manager, you know, just to kick in the ass the lazy developers...

                  tom groezer wrote:

                  Have a nice evening

                  Thanks (actually it's, morning here).

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  T Offline
                  T Offline
                  tom groezer
                  wrote on last edited by
                  #9

                  That means you are not one Best of luck on your journey of becoming a a******le. Parese the space in between now :))

                  CPalliniC 1 Reply Last reply
                  0
                  • T tom groezer

                    That means you are not one Best of luck on your journey of becoming a a******le. Parese the space in between now :))

                    CPalliniC Offline
                    CPalliniC Offline
                    CPallini
                    wrote on last edited by
                    #10

                    tom groezer wrote:

                    a******le. Parese the space in between

                    I'm not able to skip the blanks and the tabs, please provide me code... :-\

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    In testa che avete, signor di Ceprano?

                    T T 3 Replies Last reply
                    0
                    • CPalliniC CPallini

                      tom groezer wrote:

                      a******le. Parese the space in between

                      I'm not able to skip the blanks and the tabs, please provide me code... :-\

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                      [My articles]

                      T Offline
                      T Offline
                      tom groezer
                      wrote on last edited by
                      #11

                      U r a real dumb physivally if not in software world if you r not able to decode that mr AH

                      1 Reply Last reply
                      0
                      • CPalliniC CPallini

                        tom groezer wrote:

                        a******le. Parese the space in between

                        I'm not able to skip the blanks and the tabs, please provide me code... :-\

                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                        [My articles]

                        T Offline
                        T Offline
                        tom groezer
                        wrote on last edited by
                        #12

                        U r a real dumb physivally if not in software world if you r not able to decode that mr AH bahut sulag rahi hein tumhari lekin

                        CPalliniC 1 Reply Last reply
                        0
                        • T tom groezer

                          U r a real dumb physivally if not in software world if you r not able to decode that mr AH bahut sulag rahi hein tumhari lekin

                          CPalliniC Offline
                          CPalliniC Offline
                          CPallini
                          wrote on last edited by
                          #13

                          Ranting in your mother language won't help you, my dear... :)

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                          [My articles]

                          In testa che avete, signor di Ceprano?

                          T 1 Reply Last reply
                          0
                          • CPalliniC CPallini

                            Ranting in your mother language won't help you, my dear... :)

                            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                            [My articles]

                            T Offline
                            T Offline
                            tom groezer
                            wrote on last edited by
                            #14

                            :) but it is helping you AH.

                            CPalliniC 1 Reply Last reply
                            0
                            • T tom groezer

                              I guess you are not a software developer but rather a philoshpher who thinks about those sentences. I need a urgent fix and dont want to travel googling. I guess the forum is to get answer and not to fight around and highjacking

                              C Offline
                              C Offline
                              Covean
                              wrote on last edited by
                              #15

                              tom groezer wrote:

                              I guess the forum is to get answer and not to fight around and highjacking

                              There you are right. But its not a forum to support lazy developers to earn money as easy as possible. And sorry to say it so, but I think CPal has already proven that he is a real developer (and maybe also a philosopher ;P ). You didn't!

                              tom groezer wrote:

                              I need a urgent fix

                              I will vote urgent as the "lazy developers word of the year".

                              Greetings Covean

                              CPalliniC 1 Reply Last reply
                              0
                              • C Covean

                                tom groezer wrote:

                                I guess the forum is to get answer and not to fight around and highjacking

                                There you are right. But its not a forum to support lazy developers to earn money as easy as possible. And sorry to say it so, but I think CPal has already proven that he is a real developer (and maybe also a philosopher ;P ). You didn't!

                                tom groezer wrote:

                                I need a urgent fix

                                I will vote urgent as the "lazy developers word of the year".

                                Greetings Covean

                                CPalliniC Offline
                                CPalliniC Offline
                                CPallini
                                wrote on last edited by
                                #16

                                Thank you. :)

                                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                [My articles]

                                In testa che avete, signor di Ceprano?

                                T 1 Reply Last reply
                                0
                                • T tom groezer

                                  :) but it is helping you AH.

                                  CPalliniC Offline
                                  CPalliniC Offline
                                  CPallini
                                  wrote on last edited by
                                  #17

                                  tom groezer wrote:

                                  but it is helping you AH

                                  I'm glad to be a representative of the Austro-Hungarian empire. As about you, well, hiding behind acronyms or Hindi language makes you just a coward, a plain, silly, dumb coward. :)

                                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                  [My articles]

                                  In testa che avete, signor di Ceprano?

                                  1 Reply Last reply
                                  0
                                  • CPalliniC CPallini

                                    Thank you. :)

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                    [My articles]

                                    T Offline
                                    T Offline
                                    tom groezer
                                    wrote on last edited by
                                    #18

                                    I think you guys are all slaves of that palini the ASHO. I can see the forum for his developement skills. Looks like he is a frsutrated devloper in and needs some moksha. Let me know if you need that :)

                                    T 1 Reply Last reply
                                    0
                                    • T tom groezer

                                      I think you guys are all slaves of that palini the ASHO. I can see the forum for his developement skills. Looks like he is a frsutrated devloper in and needs some moksha. Let me know if you need that :)

                                      T Offline
                                      T Offline
                                      tom groezer
                                      wrote on last edited by
                                      #19

                                      Ganje (Read bald in your mother tongue :)) aadmi ka aise hee haal hota hein

                                      CPalliniC 1 Reply Last reply
                                      0
                                      • T tom groezer

                                        Ganje (Read bald in your mother tongue :)) aadmi ka aise hee haal hota hein

                                        CPalliniC Offline
                                        CPalliniC Offline
                                        CPallini
                                        wrote on last edited by
                                        #20

                                        tom groezer wrote:

                                        Ganje (Read bald in your mother tongue Smile ) aadmi ka aise hee haal hota hein

                                        Of course you missed my mother tongue. I see you have a brilliant brain. :rolleyes:

                                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                        [My articles]

                                        In testa che avete, signor di Ceprano?

                                        L 1 Reply Last reply
                                        0
                                        • CPalliniC CPallini

                                          tom groezer wrote:

                                          Ganje (Read bald in your mother tongue Smile ) aadmi ka aise hee haal hota hein

                                          Of course you missed my mother tongue. I see you have a brilliant brain. :rolleyes:

                                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                          [My articles]

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #21

                                          CPallini wrote:

                                          Of course you missed my mother tongue.

                                          Take it as a compliment. Hell, your English is probably better than mine. :laugh:

                                          L u n a t i c F r i n g e

                                          CPalliniC 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups