TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sanju Singh
NA
280
44.3k
Fast copying of data to a file
Feb 27 2015 1:00 AM
hello,
i wish to know if there is a way to copy data to a file faster then the following approach used below ? What i am doing is to write matrix/array data to a .cvs file. there are on an average 150,000 elements in the array/matrix with each element having three double data type members.The code is here:
var path = Path.Combine(myData, "KinectData-" + time + ".txt");
// start writing the data to file
for (int i = 0; i < maxLen; i++)
{
System.IO.File.AppendAllText(@path, Convert.ToString(p1[i].X) + " ," + Convert.ToString(p1[i].Y) + " ," + Convert.ToString(p1[i].Z) + Environment.NewLine);
System.IO.File.AppendAllText(@path, Convert.ToString(p2[i].X) + " ," + Convert.ToString(p2[i].Y) + " ," + Convert.ToString(p2[i].Z) + Environment.NewLine);
}
The time taken for this process is close to 3 min which i wish to minimize.any solution will be of great value to me.
Thank you
Reply
Answers (
5
)
Team Foundation Server
asp.net