View Single Post
  #9   Report Post  
Harald Staff
 
Posts: n/a
Default

A macro is a piece of programming code. The one I sent you will open your
big text file and generate many new smaller ones, each containining 20000
rows from your original file.

To run this, do the following:
Open excel. Open a new blank workbook.
Open the Visual basic Editor (by Alt F11 or by menu Tools Macro VB
Editor).
Inside the VB editor, go menu Insert Module.
You will see a white document now. This is a module. Copy-paste my
programming code into it, starting with the word Sub and ending with the
line End Sub.

Inside this code are two things you must consider:

1 The folder-file specifications to be written. In my code it says twice
"C:\Temp\Part"
You need a folder C:\Temp on your computer and you must be allowed to write
to it. If not then change this in the code so that it writes to anoether
location than C:\Temp

2 The number 20000 .This is the number of lines in the new textfiles. Change
if 20000 is too many or to few.

Now return to Excel. In its menu Tools Macro Run you can start the
macro. When you run it it asks you to open the textfile. Choose your big AOP
textfile in this dialog, or Cancel to abort the macro. The macro will run
for a while, and you will not see anything happening except an indicator
down left in the excel window.

After the macro you can hopefully open the file "C:\Temp\Part00000001.txt"
and its relatives in Excel.

This was hopefully suffif\cient macro details. Did you try to import the
textfile to Access ? That may be a far better way to solve this.

Best wishes Harald

"Khawajaanwar" skrev i melding
...
Please explain how I wrote Macros in C:\Temp folder since I am a bigginner
and i don't know how to write Macros in C:\Temp folder. My text file name
is
"AOP". Please explain in details

"Harald Staff" wrote:

This is impossible to answer detailed enough without knowing the
structure
of the huge textfile. But try to open Access and create a new empty
database
with the opening wizard. Then go menu
File Get external data Import
choose textfile as filetype, point to your enormous file and try to
import
it.

This is really not a beginner task. You are given Office and an enormous
textfile without further instructions, and maybe or maybe not someone
will
pay his tax if you can solve it ? We should do this, my friend, if only
for
the fun of it. Did my previous macro solution make any sense, or is it
unknown territory ?

Best wishes Harald

"Khawajaanwar" skrev i melding
...
I actually working in the tax department in Pakistan, i have to
extracts

the
data where in a column A or B number 26, 12 and 13 are written. Please
explain in details since i am bigginner and using Microsoff Office XP
2000

or
is there any way i can open this complete file in MS Access

Thanks again