Help! problem with sorting of a file..
-
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
-
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
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? -
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?how can i do that read by byte-by-byte? it will solve my problem? tnx... regards, JayR