Scripts: The example of the work with the CSV file as with a table

 

The example of the work with the CSV file as with a table:

The CSV file was written to write economic news but there was a problem that the Terminal does not distinguish lines, exactly their number when working with the CSV file. That is why I decided to share my solution of this problem.

Output result of the script.

Author: Denis Lazarev

[Deleted]  

I made a two-dimensional string array for it, filled it, and then could work with each cell separately. It was also a problem to know how many columns are in the file.

But this number is almost always predefined.

 

A typo in the publication title! An example of working with a CSV file as a table

 
GODZILLA:

There is a typo in the publication name! An example of working with a CSV file as a table.

Thank you.
MrGold166:

I made a two-dimensional string array for this, filled it, and then could work with each cell individually. It was also a problem to know how many columns are in the file.

But almost always this number is predefined.

I also originally made an array for this, but with a small improvement - this method is more convenient, because it is much more convenient to add news in xls, for the sake of which I made this method, and the number of rows does not matter in it. To store an array with parameters for something I would naturally choose an array. The disadvantage might be a shorter runtime, but I think when the array gets huge, the advantage slowly goes to my method. I am happy to listen to criticism, maybe there is something to improve and where to develop the idea, for example, writing a VBA-script to convert news from the site to csv initially.
 
<br/ translate="no">

the only nuance is the need to know the number of columns.

Usually in csv readers the number of columns is determined automatically by the first row data.

-------------

and how will you read the string if user specified 5 columns with 10 available ';' in the string ?

 
sergeev:

usually in csv readers - the number of columns is determined automatically by the data of the first row.

-------------

and how will you read the string if the user has specified 5 columns with 10 ';' in the string ?

1) Alternatively, you can also use the end of line identifier.

2) ";" is a column separator when converting xls to csv, there is such a saving parameter.

Besides, there are no ideal programmes from the point of view of convenience, because it is a program code and it likes design rules, and it will not do something more than what it is designed for.

So I think the user will have to think of another symbol instead of ";".

Naturally, if you have a suggestion to make this approach better - I will be only glad to listen to the suggestion, I like when I am pointed out my mistakes and shown the best method.

 

All right. That's it.

I've looked at your code.

I can tell you it's a level 80 GODZILLA.

---------

For the Administration(Automated-Trading) - guys, you can't be like this. It's not the first of April for fun.

 
sergeev:

All right. That's it.

I've looked at your code.

I can tell you it's a level 80 GODZILLA.

---------

For the Administration(Automated-Trading) - guys, you can't be like this. It's not the first of April for fun.

+100500
 
sergeev:

All right. That's it.

I've looked at your code.

I can tell you it's a level 80 GODZILLA.

---------

For the Administration(Automated-Trading) - guys, you can't be like this. It's not the first of April for fun.

This is comparing with me, or is it as a fact?))))))
 
sergeev:

I can say - GODZILLA level 80.

Yay, yay, yay )
 
Woah, is it even possible to post such codes here? O_o