| | |
[C++] append() to each row of a text file
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2006
Posts: 4
Reputation:
Solved Threads: 0
Hello.. is it possible to append some data on a text output file appending the data to each row, and without use too much computational I/O ??
Instead of the classical way:
.. I would like to use the much more redeable:
where the 1,2 series are wroted on different times.. a sort of a appendByRow() function.. and I would avoid of load the whole file in memory and then printing it line-by-line..
is it possible ??
Instead of the classical way:
C++ Syntax (Toggle Plain Text)
VARX VARY VARZ... year1 x1 y1 z1 year2 x2 y2 z2
C++ Syntax (Toggle Plain Text)
year1 year2 .. VARX x1 x2 ... VARY y1 y2 ... VARZ z1 z2 ... ...
is it possible ??
>I would avoid of load the whole file in memory and then printing it line-by-line..
Read a line, process it, and write it to a temporary file. Then delete the original file and rename the temporary.
>is it possible ??
It's hard to say. You talk about appending to a row, but your description of the desired result suggests that you want to transpose a matrix, which makes your storage and performance requirements more difficult to meet.
Read a line, process it, and write it to a temporary file. Then delete the original file and rename the temporary.
>is it possible ??
It's hard to say. You talk about appending to a row, but your description of the desired result suggests that you want to transpose a matrix, which makes your storage and performance requirements more difficult to meet.
New members chased away this month: 5
![]() |
Similar Threads
- read from database and writing the contents into a text file (C)
- How to delete a row in text file? (Visual Basic 4 / 5 / 6)
- How to send text to a text file using j2me through http connection? (Java)
- Output in Text file-How to apply fprintf()? (C)
Other Threads in the C++ Forum
- Previous Thread: Cable Bill Program
- Next Thread: Try to determine maximum and minimum values - and how many times they appear
Views: 3976 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






