chappyware Posted November 3, 2010 Report Share Posted November 3, 2010 I'm new to ME variables so please don't jump on me if this is a stupid question. I have a text file with each line being a person's name. I want to use a macro to type that name into a application I use. I know how to do that for a literal but reading up I think the VARIABLE FROM FILE reads in the whole file as a single variable. 1. Is that assumption true? 2. If so, how do I get T1,T2,T3,T4...T99 to each be a name from the sequence? There is a CR after each name. ANY help would be greatly appreciated. I have the rest of the macro done but I have no idea how to change the value of the variable or how to assign each line to a new variable (I suppose redefining T1 with a new name would be more efficient-can that be done?????) Thank yo SO much for any assistance. Jan Quote Link to comment Share on other sites More sharing options...
chappyware Posted November 3, 2010 Author Report Share Posted November 3, 2010 I think the answer is in another post about TEXT BEGIN and ASCII CHAR. I'll figure this one out on my own. Quote Link to comment Share on other sites More sharing options...
kevin Posted November 3, 2010 Report Share Posted November 3, 2010 You are on the right track. Use the 'Text File Begin Process' command to create a loop. The technique is also mentioned in the November 2010 edition of the Macro Express News email newsletter. Quote Link to comment Share on other sites More sharing options...
Mufune Posted February 11, 2012 Report Share Posted February 11, 2012 I've got a problem with this type of function..... Big picture, I just want to pull individual variables from each line in the CSV and then have them treated as individual variables unique to only one line in the CSV. I've read every help file I can find, I've read every forum post that I can find, I bought a book on macro express, I bought macro express pro...I'm days and days into trying to figure this out with no luck. Originally, when I have a CSV file, it might look like this: Thinger1, Dinky1, Ferbix1 Thinger2, Dinky2, Ferbix2 Thinger3, Dinky3, Ferbix3 Thinger4, Dinky4, Ferbix4 I'll then process the ASCII file starting with variable T1 T1 will then contain: Thinger1 Thinger2 Thinger3 Thinger4 But instead, I JUST want it to contain: Thinger1 I then attempted to use the split string function to separate Line 1 (Thinger1, Dinky1, Ferbix1) into individual elements with a new variable that I created: Variable1: Thinger1 Variable2: Dinky1 Variable3: Ferbix1 After I'm done processing line 1, I will need to then start with line 2 (Thinger2, Dinky2, Ferbix2) and also have each of those individual elements that I can use. For example, I just then want T1 to contain Thinger2. I don't care if it becomes "T4", I just want it to be an individual element and not an array of values that can't entered into a field online. One problem is that there are no real examples of how to do this. There are all sorts of variables within the ASCII process function that seem to change things. Such as whether to process the file into an array or not. If I dont process into an array, it tells me that the variable is too short and dumps my macro. I have the same problems when I try to split strings....the end result is seen in some examples, but individual small changes when the code is built have bearing on how all this cooperates. I cant make any sense of it. Please help!! Quote Link to comment Share on other sites More sharing options...
Samrae Posted February 13, 2012 Report Share Posted February 13, 2012 The Text File Begin/End Process commands get the entire line into a variable. The ASCII File Begin/End Process command will divide each element on a line into separate variables. If the information is in the wrong variables you can copy from one variable to another inside the Begin/End process loop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.