Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'export filename loop to vary' topicStudent Support Forum > General > Archives > "export filename loop to vary"

Next Comment >Help | Reply To Topic
Author Comment/Response
howie
09/17/10 11:12pm

Hi,

I am writing a program to save data sets in the form of a .txt file. as shown below

Initial:

Export["pixel_3.txt",ReplacePart[Table[0,{20}],3->44]]

I tried writing a loop to automate saving the .txt in the process but i cant get the program to execute? My trouble is getting the "filename" to vary with the Do loop? my code is written below.

Final:

Do[Export["pixel_"n".txt",ReplacePart[Table[0,{20}],n->44]],{n,20}]
where n is variable.

Any help would be great
Thanks
howie


URL: ,

Subject (listing for 'export filename loop to vary')
Author Date Posted
export filename loop to vary howie 09/17/10 11:12pm
Re: export filename loop to vary Peter Pein 09/19/10 07:27am
Re: export filename loop to vary howie 09/20/10 3:31pm
Next Comment >Help | Reply To Topic