Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1053

 
Alexandr Sokolov:

After testing, I upload the data to a file - everything works, but I can't figure out why there's an extra space, because I have one at the end of the string


"Carriage return" (\r) try removing

 
Yurij Kozhevnikov:
Every new FileWrite starts on a new line anyway. Remove the "\r\n" at the end and you'll be fine.

Thank you!

 

Who understands Excel, can you tell me why the graph is not displayed? (text file with data attached, uploaded it through the "data" tab then "from text")


The picture "displayed" the data from column A. How to correct the situation?

And this error is present on two PCs and different versions of Excel

Files:
test.txt  186 kb
 
Alexandr Sokolov:

Who understands Excel, can you tell me why the graph is not displayed? (text file with data attached, uploaded it through the "data" tab then "from text")


The picture "displayed" the data from column A. How to correct the situation?

And this error is present on two PCs and different versions of Excel

Apparently the system settings as a delimiter of integer part and fractional part is used , comma, and in the book is loaded with a point and all data are read as text.

You can select all columns, press ctrl+H and replace dots with commas in the selected fragment.

Either change in the system settings and reopen the book.

 
Alexandr Sokolov:

Who understands Excel, can you tell me why the graph is not displayed? (text file with data attached, uploaded it through the "data" tab then "from text")


The picture "displayed" the data from column A. How to correct the situation?

And this error is present on two PCs and different versions of Excel

What and where do you click?

This is how I did it:

Step 1

Step 1


Step 2

Step 2


Step 3

 

Yes, "get data" doesn't do the trick.

But if you open a text file, copy and paste everything into a cell and apply "text by column" you get a normal table:


 
It turns out that with "from text file" the data is obtained as text (this can be seen, as the text is pressed to the left edge of the cells). How to get numbers from a text file, rather than text, I have not yet understood.
 
Vladimir Karputov:
It turns out that with the "from text file" data is obtained as text (it can be seen, as the text is pressed to the left edge of the cells). How to get numbers rather than text from a text file, I have not yet understood.

They are in text format because they have a decimal point. Those without a dot (integers) will be in numeric format. Just Ctrl-H solves it, as Alexey Viktorov already wrote. Excel's eternal problem is the decimal separator.

 
Alexey Viktorov:

The system settings seem to use a comma as the separator between integer part and fractional part, while the book is loaded with a dot and all data is read as text.

You can select all columns, press ctrl+H and replace dots with commas in the selected fragment.

Or change in the system settings and reopen the book.

THANK YOU SO MUCH!!!
I couldn't figure out what the problem was for over an hour

 
Alexandr Sokolov:

It is better to open the file directly - without applying the "Get data from text file" command. (File - Open - Browse). This way the data will be recognised correctly immediately.

Reason: