Pages: [1]   Go Down
Author Topic: Search for a charactter in a file  (Read 557 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please,
1)i want to konw if there is any function that Search for a certain character,nut without using the 'read' function

thank you 
Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 17
Posts: 781
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And where are you searching for this character?  our post title says 'in a file'.  Is this some file on an SD card?

Why exactly do you not want to use the 'read' function?  How else do you expect to read data from a file?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes the file in Sd card,
the file will be very very long,and i don't want to spend a lot of time to read byte after byte
i'm writing every 10 s the temperature on the file
this file will be passed to an java sript evry time that there is some web request,when i recieve the request i need write in the end of the file ' ]' to close the function,
but once the web request finish ,i need to cancel the ']',and write th temperture
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33288
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Even if there was a function to do this it would have to use the read function to acheave it.
There is no other way, something has to read every byte, that is how computers work.
Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 17
Posts: 781
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
this file will be passed to an java sript evry time that there is some web request,when i recieve the request i need write in the end of the file ' ]' to close the function,
but once the web request finish ,i need to cancel the ']',and write th temperture

In that scenario, I would never write the ] to the file, but include it in the output to the java script.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

do you know any function to do this?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33288
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Why it is only three lines at most if the file is open.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12520
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

when i recieve the request i need write in the end of the file ' ]' to close the function

I don't understand why you need to do that. Can you explain?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: