Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15233 > unrolled thread
| Started by | Sseziwa Mukasa <mukasa@gmail.com> |
|---|---|
| First post | 2013-07-23 08:42 +0000 |
| Last post | 2013-09-24 07:58 +0000 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Writing numeric data to CSV does not write final EOL Sseziwa Mukasa <mukasa@gmail.com> - 2013-07-23 08:42 +0000
Re: Writing numeric data to CSV does not write final EOL Alan <alan.isaac@gmail.com> - 2013-09-17 09:31 +0000
Re: Writing numeric data to CSV does not write final EOL Sseziwa Mukasa <mukasa@gmail.com> - 2013-09-19 05:19 +0000
Re: Writing numeric data to CSV does not write final EOL David Bailey <dave@removedbailey.co.uk> - 2013-09-24 07:58 +0000
| From | Sseziwa Mukasa <mukasa@gmail.com> |
|---|---|
| Date | 2013-07-23 08:42 +0000 |
| Subject | Re: Writing numeric data to CSV does not write final EOL |
| Message-ID | <kslfm0$pnu$1@smc.vnet.net> |
You can append an empty row:
Export["C:/tmpfile.csv", Append[mytable,{}], "csv"];
On Jul 21, 2013, at 4:22 AM, kogan.clark@gmail.com wrote:
> Hi!
>
> I am using Mathematica 8 to write a numeric matrix to a csv file using the commands:
>
> mytable = {{1, 2}, {3, 4}};
> mytable = Export["C:/tmpfile.csv", mytable, "csv"];
>
>
> This produces a file, but does not put a final line end character after the 4. I am trying to read this file with R, which requires the final line end character. I was wondering if anyone knew the simplest (or a very simple) way to add the additional line end character.
>
> Thanks!
>
> Clark
>
[toc] | [next] | [standalone]
| From | Alan <alan.isaac@gmail.com> |
|---|---|
| Date | 2013-09-17 09:31 +0000 |
| Message-ID | <l197go$97o$1@smc.vnet.net> |
| In reply to | #15233 |
On Tuesday, July 23, 2013 4:42:40 AM UTC-4, Sseziwa Mukasa wrote:
> Export["C:/tmpfile.csv", Append[mytable,{}], "csv"];
If ``mytable`` is huge, won't this require the temporary creation of another huge list?
Alan Isaac
[toc] | [prev] | [next] | [standalone]
| From | Sseziwa Mukasa <mukasa@gmail.com> |
|---|---|
| Date | 2013-09-19 05:19 +0000 |
| Message-ID | <l1e1g6$l2t$1@smc.vnet.net> |
| In reply to | #15233 |
You're right, this will make a temporary copy of the list. Alternatively, export the table:
Export["C:/tmpfile.csv",mytable];
then:
fileStream=OpenAppend["C:/tmpfile.csv"];
WriteString[fileStream,"\n"]
Close[fileStream];
Regards,
Sseziwa
On Sep 17, 2013, at 9:34 PM, Alan <alan.isaac@gmail.com> wrote:
> On Tuesday, July 23, 2013 4:42:40 AM UTC-4, Sseziwa Mukasa wrote:
>> Export["C:/tmpfile.csv", Append[mytable,{}], "csv"];
>
>
> If ``mytable`` is huge, won't this require the temporary creation of another huge list?
>
> Alan Isaac
>
[toc] | [prev] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2013-09-24 07:58 +0000 |
| Message-ID | <l1rgno$q2u$1@smc.vnet.net> |
| In reply to | #15475 |
On 19/09/2013 06:19, Sseziwa Mukasa wrote: > You're right, this will make a temporary copy of the list. Alternatively, export the table: > Mathematica seems to keep track of which parts of an expression have been altered, so my guess is that all the sublists would not be copied. Therefore the cost would be fairly small - I would take this approach first, and possibly time it to determine if it is more costly than performing the original Export. David Bailey http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web