D
D
dadster2014-09-18 14:41:37
excel
dadster, 2014-09-18 14:41:37

What is the best way to parse an excel file?

There are excel files, several hundred.
From them, you need to somehow extract some lines, according to a given principle (the text in them is different).
And to fill in these lines in one new file.
You can do it by hand, but lazy. And there is also an option that this task will be repeated periodically.
Tell me, please, what tools are best to do this programmatically? Automatically open all files in the directory one by one, parse, take the necessary lines, upload them to a new file.
Maybe someone had a similar experience.
I started looking towards python and www.python-excel.org
Maybe it's better to make it visual basic? Or is there such a possibility in Excel itself?
Thank you!
PS I did everything like this: first I found a plug-in for Excel, which quickly and freely merges many Excel files into one. There he is.
Then I looked for specific macros that delete lines according to various criteria, such as an empty cell, text in a cell, numbers in a cell.
In general, I didn’t even have to deal with VBA much, I did everything with ready-made tools.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Fedoryan, 2014-09-18
@dadster

I wrote a macro in Excel itself (in VBA), opened files one by one, searched for the necessary lines and copied them into my document. (detailed examples of opening and reading files on the network are enough)
You can use any tool that you know how to use / like / work with Excel.
You can simply pull out these lines and then form a file based on them. Here is what is more convenient for you. (this would be done in Delphi or VB).
Excel itself has a VLOOKUP function, but you have to write a formula for each document. Python can also work for this.

T
throughtheether, 2014-09-18
@throughtheether

Tell me, please, what tools are best to do this programmatically? Automatically open all files in the directory one by one, parse, take the necessary lines, upload them to a new file.
When I needed to extract certain data from an .xlsx file, the openpyxl module helped me . Another thing is that I saved the result in csv format, so I can't say how mature the python modules are for creating .xlsx files. In general, I think your problem can be solved in python.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question