air1access
Technical User
I have a text file that I need to import into an Access table. But first it must be formated...
The text file looks like this:
A-A-59173 USA 04-017
A-A-59173 USA 04-521
A-A-59474 USA 08-097
A-A-59474 USA 08-097A
A-A-59474 USA 08-097B
A-A-59503 TYPE I GRADE B CLASS 1 USA 19-014
ABGN/44/83324 GB 09-016
ABP 4-1123 UK 16-006D
ABP 4-2128 GB 16-021B
ABP1-4053 GB 05-064
ABP4-1123 GB 16-006E
ABP4-2124 GB 16-042A
ABR 1-4055 GB 06-011
ABR 9-0140 GB 11-026
I need for it to be like this:
A-A-59173 USA 04-017
A-A-59173 USA 04-521
A-A-59503 TYPE I GRADE B CLASS 1 USA 19-014
ABP 4-1123 UK 16-006D
ABP 4-2128 GB 16-021B
Basically - everything from and after "USA" or "UK" or "GB" needs to be moved over a few spaces to "make a column"... And everything before "USA" or "UK" or "GB" is a seperate column... Sure hope this makes sense..!!
The below example is what I'm working with...
Well - kinda... Its like its almost there...!!
Open strInFile For Input As #1
Open strOutFile For Output As #2
Do While Not EOF(1)
Line Input #1, strLine
strType = Left(strLine, InStr(strLine, "USA") - 2)
strType = Mid(strLine, InStr(strLine, "USA "))
Print #2, strType
Line Input #1, strType
Loop
Any examples or suggestions...?
I thank you in advance...!!
air1access
The text file looks like this:
A-A-59173 USA 04-017
A-A-59173 USA 04-521
A-A-59474 USA 08-097
A-A-59474 USA 08-097A
A-A-59474 USA 08-097B
A-A-59503 TYPE I GRADE B CLASS 1 USA 19-014
ABGN/44/83324 GB 09-016
ABP 4-1123 UK 16-006D
ABP 4-2128 GB 16-021B
ABP1-4053 GB 05-064
ABP4-1123 GB 16-006E
ABP4-2124 GB 16-042A
ABR 1-4055 GB 06-011
ABR 9-0140 GB 11-026
I need for it to be like this:
A-A-59173 USA 04-017
A-A-59173 USA 04-521
A-A-59503 TYPE I GRADE B CLASS 1 USA 19-014
ABP 4-1123 UK 16-006D
ABP 4-2128 GB 16-021B
Basically - everything from and after "USA" or "UK" or "GB" needs to be moved over a few spaces to "make a column"... And everything before "USA" or "UK" or "GB" is a seperate column... Sure hope this makes sense..!!
The below example is what I'm working with...
Well - kinda... Its like its almost there...!!
Open strInFile For Input As #1
Open strOutFile For Output As #2
Do While Not EOF(1)
Line Input #1, strLine
strType = Left(strLine, InStr(strLine, "USA") - 2)
strType = Mid(strLine, InStr(strLine, "USA "))
Print #2, strType
Line Input #1, strType
Loop
Any examples or suggestions...?
I thank you in advance...!!
air1access