PDA

View Full Version : Need help on csv



yaiza94
08-27-2009 11:09, 11:09 AM
Can some developer please help me.
H = FileOpen(D.csv,FILE_READ | FILE_WRITE,';'-RRB-;
opened the file and
compose it
FileWrite(H,Open[0]);
with dual H announced
but
double C;
if(Hgt;0)

CFileReadNumber(H);
FileClose(H);

does not read anything.
Error 4051.
Also, how to make it write to next column instead of placing delimiter ';'?
Thanks Beforehand.

yaiza94
11-13-2021 03:10, 03:10 AM
I understand that the question is tough. It is one of the things in the programming and not the answer is known by all developers.
Can there be on this forum some programmer who understands the answer?
Looks like nobody understands.

bmigisg
11-13-2021 04:30, 04:30 AM
I understand the question is hard. It's one of the points in the programming rather than all developers know the solution.
Is there on this forum some programmer who understands the answer?
Looks like nobody understands. Nobody knows based on the pitiful information you have posted. Instead of just imagining snippets of code which do not paint the picture of exactly what your mistake laden program is performing not post the file so somebody can dig it and clean up the mess you left behind?

yaiza94
11-13-2021 05:51, 05:51 AM
Magnumfreak,
Thank You for the reply.
I know you're an expert in programming. I saw your posts.
Here you go:
double H;
H= FileOpen(D.csv,FILE_READ | FILE_WRITE,';'-RRB-;
if(Hgt;0)

FileWrite(H,Open[0]);//, Close[0]);// delimiter ';' is added
FileClose(H);

double C;
if(Hgt;0)

C=FileReadNumber(H);
FileClose(H);

//Comment(C);
Comment(GetLastError());
return(0);
}
it cannot read the number and it lays ';' instead of writing into the next column

vimginay
11-13-2021 07:12, 07:12 AM
What's the data type of file handles? Highlight FileOpen and hit F1.

bmigisg
11-13-2021 08:33, 08:33 AM
Magnumfreak,
thanks for the Answer.
I know you're an expert in programming. I saw your posts.
Here you go:
double H;
H= FileOpen(D.csv,FILE_READ | FILE_WRITE,';'-RRB-;
if(Hgt;0)

FileWrite(H,Spacious[0]);//, Close[0]);// delimiter ';' is inserted
FileClose(H);

double C;
if(Hgt;0)

C=FileReadNumber(H);
FileClose(H);

//Comment(C);
Comment(GetLastError());
return(0);
}
it cannot read the number and it sets ';' instead of writing to another column Probably because you shut the file once you write the data to it you never re open the file prior to attempting to read out of it.

yaiza94
11-13-2021 09:54, 09:54 AM
Magnumfreak,

it works!!! Thank you.
May I ask you how to write to
the next column since
it inserts delimiter within the exact same column.
I tried and it did not
work.
Please assist.
Thank you.

bmigisg
11-13-2021 11:14, 11:14 AM
FileSeek(handle, 0, SEEK_END);

Just tell it to move into the end of the file Using All the FileSeek command.

yaiza94
11-13-2021 12:35, 12:35 PM
I didn't try but I could not make it.
But did it other way and it works also.
But thanks to your time.
Can I ask you next assistance?
H= FileOpen(DD.csv,FILE_CSV, ';'-RRB-;
double C;
if(Hgt;0)

C =FileReadNumber(H);//allow me believe
FileClose(H);

Comment(C);
1) the way to read the amount that's at 2nd line of the 2nd row
2) is it possible to get Open[0] into the document
from the next broker?
Thank you very much.

yaiza94
11-13-2021 13:56, 01:56 PM
Help pleases, since Magnumfreak is busy.
Thank you.

yaiza94
11-13-2021 15:17, 03:17 PM
Can help please?
H= FileOpen(DD.csv,FILE_CSV, ';'-RRB-;
double C;
if(Hgt;0)

C =FileReadNumber(H);//I'd like to believe
FileClose(H);

Comment(C);
1) the way to read the amount that's at 2nd line of this 2nd row
2) is it possible to get Open[0] to the document
in the next broker?
Thank you very much.

yaiza94
11-13-2021 16:37, 04:37 PM
No one wants to help.
That is OK with me.
Is on this forum at least one great person that
can provide me an advice on the best way best to work with csv files?
I think there is not any developer who understands everything.
Some bug may take days to find it. Is it tough to assist?
What's this programming discussion department?
Is it just to provide a vague responses to show that I am an expert and
that see and get more clients? What about getting good will?
This ribbon is finished for me.

mojokem
11-13-2021 17:58, 05:58 PM
Nobody wants to help.
That's OK with me.
Is on this forum at least one great man that
can give me an advice on the best way to work with csv files?
I believe there isn't any developer who knows everything.
Some bug may take days to loe it. Is it tough to assist?
Why is this programming discussion department?
Is it just to give a vague responses to show that I'm a professional and
that see and get more customers? What about having good will?
This thread is finished for me. 1.) Every built-in part is recorded in the reference. Read the documentation to get FileReadNumber(). This function will read in the current loion to another delimiter.

1a) So logically if you've got just two numbers on one line you have to call it two times per line.

1b) If you want to see a line aside from the initial one, you have to first read the other lines before online, because there isn't any method of guessing where exactly you should put the filepointer for a given line, because they dont have fixed dimensions.

2) the filetype of file handles is int, not twice. You might have found that in the documentation to the FileOpen() function.

3) if you want to know programming then do not begin with mql4. This will not work! If you do not need to understand programming quit mesing around with mql4!

If you want to know programming (you should really want it), there are lots of resources on the internet and newcomer programming languages. I suggest you make the initial steps by studying Python. After you mastered the very first steps and feel less protected in the very basics of programming (variables, functions, classes, items) you could be interested in studying a statically typed language, this may again give you a few challenges to learn and additionaly a new syntax to learn, however already learned theories remain legitimate, I suggest utilizing ObjectPascal because it unforgivingly enforces type safety, something you must be familiar with when dealing with C like languages that have a static but quite weak form system.

These two languages are great candidates for two important extremes you must have noticed and worked with before proceding to error prone and difficult to debug languages like C, C and their crippled child MQL. Both languages are simple novice friendly, free to download and use and to get started with. They are also used and that means you dont understand something theoretical .