04-23-2013 01:10 AM
Dear All,
I am using binary file which contains 2,50,000 rows and each row is having maximum 100 characters. Now i want to read
single single row at a time after every 100 ms and delete the same row which got read.
Let us consider my binary file is having 2,50,000 rows and i read 1,00,000 rows from file. Finally the file should contains 1,50,000 rows .
Please suggest me the best method for this.
Thanks in advance.
04-23-2013 03:16 AM
10-31-2013 01:10 AM
Dear sir,
i want to delete a single row element in file online but i don't want to open close the file as my process is very fast so please suggest me best file type or best method using LV2G.
10-31-2013 02:46 AM
10-31-2013 04:01 AM
Dear sir,
Please find attachment
10-31-2013 04:08 AM
Hi mom,
I would suggest a database for your approach. Here you can add and remove entries (data elements) at random order.
Using (text) files for your kind of task is quite a mess as files are continuous streams of bytes on the harddisc. Adding new data at the end is easy, removing bytes from the beginning of the file is a hassle (requires rewriting of all the remaining content). When your entries are of constant length you could work with two files, one for data and the other for an index into the data, but this is nearly the same as using a full-blown database...
10-31-2013 06:16 AM
Can i use shift register and delete element from it?
10-31-2013 06:27 AM
Hi mom,
Do you want to say taking all the values from file in an array and using delete from array for it?
If it is so the answer is no.
10-31-2013 08:14 AM
You will not be able to do what you want to do with a simple binary/text file. Your timing is too tight. Take the simple example of removing the initial line from the file. This is actually the worst case. It requires you to rewrite all data but the first line back into the file, which takes a lot of time. However, if you have control over the file format, you have much better options. You need an indexed binary file. A database (e.g. mySQL or PostgreSQL) has already been mentioned. Other options are TDMS or HDF5. You will need to use the Advanced API to delete data from a TDMS file.
Good luck. Let us know if you need more info.