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. csv file problem

csv file problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
8 Posts 4 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.
  • U Offline
    U Offline
    User 589870
    wrote on last edited by
    #1

    hi, i have to write some data to csv file and have to insert new line after every record but data is not appering in correct format i.e new line is not appearing.wat can be the problem?

    E _ 2 Replies Last reply
    0
    • U User 589870

      hi, i have to write some data to csv file and have to insert new line after every record but data is not appering in correct format i.e new line is not appearing.wat can be the problem?

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      Could you post your code line to put a text line out ? :)

      virtual void BeHappy() = 0;

      M 1 Reply Last reply
      0
      • U User 589870

        hi, i have to write some data to csv file and have to insert new line after every record but data is not appering in correct format i.e new line is not appearing.wat can be the problem?

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        If you're using \n for new line try using \r\n instead.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        U 1 Reply Last reply
        0
        • _ _Superman_

          If you're using \n for new line try using \r\n instead.

          «_Superman_» I love work. It gives me something to do between weekends.
          Microsoft MVP (Visual C++)

          U Offline
          U Offline
          User 589870
          wrote on last edited by
          #4

          strCSV = L"|" + strCSV+ char(13) + char(10); csvFile.Write(strCSV,strCSV.GetLength()); that is how i inserting.

          E U 2 Replies Last reply
          0
          • U User 589870

            strCSV = L"|" + strCSV+ char(13) + char(10); csvFile.Write(strCSV,strCSV.GetLength()); that is how i inserting.

            E Offline
            E Offline
            Eugen Podsypalnikov
            wrote on last edited by
            #5

            Try it :) :

            CString cszOut;
            cszOut.Format(_T("|%s\r\n"), strCSV);
            csvFile.Write(cszOut, cszOut.GetLength() * sizeof(TCHAR));

            virtual void BeHappy() = 0;

            1 Reply Last reply
            0
            • U User 589870

              strCSV = L"|" + strCSV+ char(13) + char(10); csvFile.Write(strCSV,strCSV.GetLength()); that is how i inserting.

              U Offline
              U Offline
              User 589870
              wrote on last edited by
              #6

              strCSV = L"|" + strCSV+ char(13) + char(10); csvFile.Write(strCSV,strCSV.GetLength()); that is how i inserting.but new line not appearing?

              U 1 Reply Last reply
              0
              • U User 589870

                strCSV = L"|" + strCSV+ char(13) + char(10); csvFile.Write(strCSV,strCSV.GetLength()); that is how i inserting.but new line not appearing?

                U Offline
                U Offline
                User 589870
                wrote on last edited by
                #7

                CString cszOut; cszOut.Format(_T("|%s\r\n"), strCSV); csvFile.Write(cszOut, cszOut.GetLength() * sizeof(TCHAR)); its workig for me great thanx.

                1 Reply Last reply
                0
                • E Eugen Podsypalnikov

                  Could you post your code line to put a text line out ? :)

                  virtual void BeHappy() = 0;

                  M Offline
                  M Offline
                  Moak
                  wrote on last edited by
                  #8

                  Thanks! I wish someone would always say that, when there is a programming question without a single line of code. :)

                  Webchat in Europe :java: Now with 26% more Twitter

                  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