Delete Text from Text Files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ...
I have text file contain such data
1111222233334444
i need delete particlar char without load all data into memory
says
delete 1st-5th char ..then the data in text file
should 222233334444.
I am not sure how to acheive it

PS.This application will run on Pocket Pc 2003

Thanks
Percy
 
* "=?Utf-8?B?UGVyY3kgTkc=?= said:
I have text file contain such data
1111222233334444
i need delete particlar char without load all data into memory
says
delete 1st-5th char ..then the data in text file
should 222233334444.
I am not sure how to acheive it

You will have to completely rewrite the file (shift its contents to left
and then set the file's length using 'FileStream.SetLength'. Have a
look at the classes in the 'System.IO' namespace and make sure the
classes/methods you use are supported in the .NET Compact Framework.
 
Hi Percy,

When I ask where it is located than it is important to know if it is in a
database of a flat textfile on disk.

If it is in a database you have only to read the items in memory from the
text, if it is in a standard textfile you have to read all the rows from
the file in a streaming way and change the text in memory.

That is one of the most important reason that people are using databases
otherwise the could maybe better use textfiles.

However, maybe is there a special type randomreadable textfile on a
pocketPC, but than I think that for that you can better ask this question
in a pocketPc newsgroup.

Cor
 
It is in the front end.
The data is stored in textfile, not database due to some technical issues.

Thanks
Percy
 
Back
Top