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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Help! problem with sorting of a file..

Help! problem with sorting of a file..

Scheduled Pinned Locked Moved C#
helpalgorithmstutorial
3 Posts 2 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.
  • J Offline
    J Offline
    jrbvillanueva
    wrote on last edited by
    #1

    guys, i have a problem with sorting of a file line by line due to unknown character (box [] chracter - similar to this but no space between the lines)encountered. It is included on the given data from the past years. During sorting line by line, the compiler encounters the box/unknown character, so the compiler will break the statement/line and will result for the new statemen/line. the problem here is that instead of one line, it produces another line to be sorted for the whole file and for that my system can not be accurate anymore. example i have a file to be sort: //To be sort: hello world! Love programming! have fun-[]--and enjoy! //[]-illustrates the unknown chracter but no spaces bet. the lines //after sorting the data will be arranged like this: --and enjoy! //it will be broke into two lines have fun- hello world! Love programming! Help me guys.. Dont know what to do... :confused::confused::confused: regards, JayR

    W 1 Reply Last reply
    0
    • J jrbvillanueva

      guys, i have a problem with sorting of a file line by line due to unknown character (box [] chracter - similar to this but no space between the lines)encountered. It is included on the given data from the past years. During sorting line by line, the compiler encounters the box/unknown character, so the compiler will break the statement/line and will result for the new statemen/line. the problem here is that instead of one line, it produces another line to be sorted for the whole file and for that my system can not be accurate anymore. example i have a file to be sort: //To be sort: hello world! Love programming! have fun-[]--and enjoy! //[]-illustrates the unknown chracter but no spaces bet. the lines //after sorting the data will be arranged like this: --and enjoy! //it will be broke into two lines have fun- hello world! Love programming! Help me guys.. Dont know what to do... :confused::confused::confused: regards, JayR

      W Offline
      W Offline
      WillemM
      wrote on last edited by
      #2

      You should read the file byte-by-byte. This will prevent your application from getting a new line everytime it encounters one of those funny block characters. BTW I think that character is either 0x10 or 0x13, this means your file is either using a linux type of linebreak, or is using incomplete linebreaks. You can check this by splitting the data on one of these characters. WM.
      What about weapons of mass-construction?

      J 1 Reply Last reply
      0
      • W WillemM

        You should read the file byte-by-byte. This will prevent your application from getting a new line everytime it encounters one of those funny block characters. BTW I think that character is either 0x10 or 0x13, this means your file is either using a linux type of linebreak, or is using incomplete linebreaks. You can check this by splitting the data on one of these characters. WM.
        What about weapons of mass-construction?

        J Offline
        J Offline
        jrbvillanueva
        wrote on last edited by
        #3

        how can i do that read by byte-by-byte? it will solve my problem? tnx... regards, JayR

        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