boilerbdub Posted July 7, 2004 Report Share Posted July 7, 2004 Here's the situation, I have a text file with about 1000 different serial numbers for parts. I need to find a way to have the macro get a value from the text file, output that value on the screen, then move to the next value in the text file. The serial numbers are on seperate lines in the text file. Is there anyway macro can do this? The closest thing I could find in macro was an option that allowed me to save the WHOLE text file to a variable and not one record from the text file. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
joe Posted July 7, 2004 Report Share Posted July 7, 2004 Hello boilerbdub! You want to look at the Text File Begin Process if it is a plain text file, or the ASCII File Begin Process command if it is something like a comma delimited file. Both commands can process data in a text file a single line at a time. Hope this helps! Quote Link to comment Share on other sites More sharing options...
Les Hazlett Posted July 8, 2004 Report Share Posted July 8, 2004 Hello boilerdub, I am doing something similar. It is quite possible. As Joe said, you can use Text File Begin Process to move through the text file line by line. So long as you don't need to move back to prior lines, it is not really too difficult. With a little work, you will be able to find the data you want and display it with most of your commands being between the Text File Begin Process command and the Text File End Process command. Good luck with your effort. Les Hazlett Quote Link to comment Share on other sites More sharing options...
boilerbdub Posted July 13, 2004 Author Report Share Posted July 13, 2004 Yes, I tried the File Read Begin Process and for some reason it saved the whole text file to the variable that it created. The lines in my text file are seperated by line breaks, and I tried seperating them with commas and it did the same thing. It just tried to save the whole file to one variable. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
floyd Posted July 15, 2004 Report Share Posted July 15, 2004 If you attach a partial file, or even the whole file to a reply, then someone can take a look at it in the forum. Maybe there is something in the file that is preventing you from doing what you want. Quote Link to comment Share on other sites More sharing options...
boilerbdub Posted August 2, 2004 Author Report Share Posted August 2, 2004 Here's the attached text file, I'm not sure if there's something in the file that is not allowing me to read the records one by one. Like I said before the macro is reading all of the record at once and putting ALL of them in one variable. Let me know if you can help. H8_CLASS4_PARTS_REPORT.TXT Quote Link to comment Share on other sites More sharing options...
Nicolas Posted August 2, 2004 Report Share Posted August 2, 2004 if this is the beginning of your attached file (saved as a plain text file) : 22442 66586 310214 332075 343664 365774 816617 904715 904885 1003149 1006896 1008254 1018926 1030880 1054284 1054285 1071091 ... this small macro reads records and displays them one by one ... Text File Begin Process: "H8_CLASS4_PARTS_REPORT_TXT.txt" Pause: Complex Text File End Process text file begin process : start processing record=1, variable to receive text line=T1 pause : message=%T1% I can't figure any problem in this ? but maybe I did not understood your problem ... Quote Link to comment Share on other sites More sharing options...
klutzo Posted August 4, 2004 Report Share Posted August 4, 2004 I had to do something similar as well... what I had to do is to use the ASCII File Begin Process "T1% (Tab Delimited Text) or whatever, then essentially saved the text out into a dump file. T1 was the dump file name. Ensure to click the Variable to Receive First Field, and it will start to process all your text files and put them into T2 - T99. The downfall of this system, is that since Macex only has 99 variables, you only have that many spots. Quote Link to comment Share on other sites More sharing options...
aoz Posted July 26, 2007 Report Share Posted July 26, 2007 I am trying to get T1 thorugh T99 filled, by reading a file, line by line. BUT, I can only get T1 to fill, each line stores itself to T1. I can't gbet it to fill sequential variables. It is just an ascii text file; each line separated by CR/LF thanks Nick Quote Link to comment Share on other sites More sharing options...
kevin Posted July 26, 2007 Report Share Posted July 26, 2007 See the sample just posted in the Step Thru An Array Of Vars discussion topic. 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.