It could have been a good solution if I didn't mind the size of the output file. I have to know in advance if the block of lines I'm about to copy doesn't exceed 65000 lines per file. If it does than I need to split it into 2 consecutive files. That's why I scanned it in advance and saved the beginning and the end of the block in an array. Inbal
Inbaljona
Posts
-
Read specific lines from txt file and write them to another file -
Read specific lines from txt file and write them to another fileIs there no way I can use line numbers to get to the specific line and start copying from there forth? Inbal
-
Read specific lines from txt file and write them to another fileSimon Stevens wrote:
Rather than only holding the line numbers in the array. Make it a string array*, and store the whole line in the array.
What happens when the file is very big (for the sake of argument 1GB)? I already thought about your solution, but it seems to me that it consume a lot of memory if I need to save the whole file into an array. If I want to focus only to copy the lines of interest which I know where they begin and where they end, how do I do it? any way to convert line numbers to file offset and use seek function get there?
-
Read specific lines from txt file and write them to another fileHi, I've got a txt file I'm parsing and need to extract specific lines from it and copy them to another file. First I scanned the file for the lines of interest by using the readline function. Each time I got a line I'm interested in I inserted the line number into an array.In the end I got an array that holds the line numbers of the lines I'm interested in coping. Meaning, the start line in one cell and end line in another, and I've got several of those in the array. How do I copy the block of lines (between 2 cells listed in the array )from one file to a new file? Do I need to sync the StreamReader of one file with the StreamWriter of the other? or are there any other better ideas as to how to do it? :^) Thanks in advance, Inbal
-
Tab pabe as a classI'm writing a window application were I would need to use tab page as an template to be used multiple times. I need an advice as to the best way to do it. Is it better to create a dialog and insert it into a new tab or create a tab page as a different form/class? 10x,
-
Tab pabe as a classI'm writting a window application were I would need to use tab page as an template to be used multiple times. I need an advice as to the best way to do it. Is it better to create a dialog and insert it into a new tab or create a tab page as a different form/class? 10x,