Reg: C-Program to get Output in a separate Row

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sivadhanekula
    New Member
    • Nov 2008
    • 58

    Reg: C-Program to get Output in a separate Row

    Hi everyone

    I have a problem while writing a C code. I need a code to get the output in table form. I have more data's and If I run the program I am getting output in one column i.e. all the required data are pouring in to one column, but I need it separately in separate row's can you tell me how can I get in a separate Row.

    Thank you
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You need to use a loop with \n for going to the next line.

    Comment

    • qartar
      New Member
      • Nov 2008
      • 12

      #3
      I believe there is no 'easy' way to format data in a console. You will have to use spacing and newlines. Search for "format specifiers" for some neat tricks for formatting specific types in printf type functions.

      Comment

      • sivadhanekula
        New Member
        • Nov 2008
        • 58

        #4
        but I have data of 11650 columns and I need that data to be splitted to 3 diff rows with three diff headings......

        Comment

        • sivadhanekula
          New Member
          • Nov 2008
          • 58

          #5
          Originally posted by r035198x
          You need to use a loop with \n for going to the next line.
          if I use \n it will go to the next line but not to the next row?????

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Why do you want to display all that data to the console? Wouldn't writing it to a file be more productive?

            Comment

            • sivadhanekula
              New Member
              • Nov 2008
              • 58

              #7
              I have written it in FILE only but if I run the program I am getting all the data in one row including the headings. I think there will be something like "\n is for printing the data in the next line" for changing into different row....

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by sivadhanekula
                I have written it in FILE only but if I run the program I am getting all the data in one row including the headings. I think there will be something like "\n is for printing the data in the next line" for changing into different row....
                Did you use the \n then? If you did and got the same results then post the code you used.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Even 11650 columns per row make up for a very very large row ...

                  kind regards,

                  Jos

                  Comment

                  • donbock
                    Recognized Expert Top Contributor
                    • Mar 2008
                    • 2427

                    #10
                    Are you inspecting your output file with a text editor, or are you importing your output file into Excel? If the latter, then you need to understand the rules Excel uses to import files and then format your output file accordingly.

                    Comment

                    Working...