A
A
anton9692020-05-21 17:24:51
PHP
anton969, 2020-05-21 17:24:51

How to display data from a txt or excel file on a website page?

Hello!
There is a file (they can provide txt or excel), you need to display a table of goods with parameters from it, an example of one line with column headings (separation by columns is "|", and line separation is ";"):
Arrival | Commodity operation number | Category | Group | Item No. | Item Description | Section | Voltage | Quantity | Unit Code | Measurements | Number of lengths | Total Weight | Net Weight | Warehouse Code | Drum No. | Drum Item Description | Reservation date | Price;
1872826 | Cable | LVO | P286210L1000120 | VVGng(A) -FRLS 1x35mk(N)-1 | 35 | 1 | 1 | KM | 1 | 530 | 461 | UGL_FG | 12807 | Drum No. 10a - sheathing with mats;
or an example of an excel file (about 800 lines)
5ec68dbab28c8390956664.png

How to display this data in a table on the site page and from which file is it better to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2020-05-21
@zkrvndm

Of course, it will be easier and more convenient to parse data from .txt, but not from excel. To form a table, use the php functions explode() and for() - this is basically enough. If you wish, you can slightly offload your server and shift table generation to the visitor's browser, respectively, if you do it in JavaScript, you will need the split (), for () and jQuery.ajax () functions for loading.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question