Re: Prepending Data to a File
- To: mathgroup at smc.vnet.net
- Subject: [mg116860] Re: Prepending Data to a File
- From: Tyler <hayes.tyler at gmail.com>
- Date: Wed, 2 Mar 2011 04:37:15 -0500 (EST)
- References: <ikihb6$7mh$1@smc.vnet.net>
On Mar 1, 5:21 am, Gregory Lypny <gregory.ly... at videotron.ca> wrote: > Hello everyone, > > I have a big multi-line, comma-delimited data file. How would I prepen= d > new data to it, that is, insert new lines, generated in Mathematica, at > the beginning of the file without importing the file into Mathematica? > > Suppose my file myData.csv contains > > 31,32,33 > 41,42,43 > 51,52,53 > > and I've now generated these two new lines (lists) in Mathematica > > 11,12,13 > 21,22,23 > Wouldn't even use Mathematica. For an entirely new file of the merged data sets.... cat newData.csv > mergeData.csv cat origData.csv >> mergeData.csv t. > I'd like to prepend those two lines to myData and end up with > > 11,12,13 > 21,22,23 > 31,32,33 > 41,42,43 > 51,52,53 > > I'm guessing that the Write function would do the trick, but I'm not > sure about the syntax. > > Regards, > > Gregory