# Mathematica 9 Iterative Import

Posted 6 years ago
6141 Views
|
4 Replies
|
0 Total Likes
|
 Hello!This was the original question I have been trying to make an iterative scheme to name a set of indexed variables to a set of indexed strings. Earlier in the document I have code which automatically exports based on a similar iterative scheme in order to have the code be flexible to the parameter lmax. This way I can automatically export data under different file names based on this parameter. Now I want to import this data and name it to a variable. I have tried many different ways, and attached is the most recent way I tried with its failure. I am failing to see the actual problem. It seems like Import is reading the literal name of the variable as opposed to its assigned value. I tried using x:= instead, but then the string gets named with "lmaxi" instead of "lmax19" or "lmax20".I am going to continue working on this, but I am a novice and I am hoping that someone more experienced may see the problem quicker than I do.Thank you for your time Now I am seeing more of the problem. The x[i] are a string, but import is having a problem recognizing that. I post this just in case someone can figure it out before me. I am on pursuit to the solution!Thank you for your time :) Attachments:
4 Replies
Sort By:
Posted 6 years ago
 P.S. This is not an actual homework assignment. I know the path makes it seem that way, but it isn't. :)
Posted 6 years ago
 Hi Phillip,I can not try, because I am working here on a Linux system (fortunately!), but your problem seems to be that you have to write your directory path like so: SetDirectory["C:\\homework\\homework"] A single backslash followed by a character has typically a special meaning, e.g. "\n" means 'newline'.Regards -- Henrik