Here is example of the text file.
I have a problem. Iâm trying to import one text file that have multiple dept num ex. 655,632,654. Is it possible for excel to read a text more than once to get information needed.Ex
D,RLG,0632,003,21,0563130,3760-6004 ,7.10X11.2 ,ARDEBIL ,IV/RED ,053,0059326924,001,00564.00,00599.00,-00035.00,006,PMD ,01,0455899
D,RLG,0632,003,21,8051518,0715-4991 ,7.10RND ,CAIRO ,MIDNIGHT ,015,0059328116,001,00549.00,00519.00, 00030.00,006,PMU ,01,0538496
D,MCE,0652,017,12,8384133,B7497A ,SOFA ,1444-326 ,ROSE ,135,0036033126,001,00839.40,00999.00,-00159.60,016,PMD ,01,0080130
D,MCE,0652,017,12,8384190,T4787M ,SOFA ,1460-723 ,TAPESTRY ,124,0035994131,001,01169.00,01299.00,-00130.00,010,PMD ,01,0034787
D,MCE,0653,008,31,7913882,2580 ,WING ,1030-40 ,BURG ,002,0036026006,002,00499.00,00598.00,-00099.00,017,PMD ,01,0505867
D,MCE,0653,008,31,7913882,2580 ,WING ,1030-40 ,BURG ,125,0036031905,002,00499.00,00598.00,-00099.00,017,PMD ,01,0044041
Excel would need to read the text file and get all data by dept num and import to excel , create sheet for each dept num.
Quote:
quote:Originally posted by acdsky
Hi
You could use File System Object to read the text file. You need to reference Microsoft Scripting Runtime. Below is a short example to read every line in the txt file:
***********************************
Dim FSO As New FileSystemObject
Dim FSTR As Scripting.TextStream
Private Sub Main()
Set FSTR = FSO.OpenTextFile("c:\myfile.txt")
Do Until FSTR.AtEndOfStream
ReadTextFile = FSTR.ReadLine
Loop
End Sub
************************************
Let me know if you need more detail
Regards
Marnus
|