Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
10 / September / 2010, 05:07:46
Home
Help
Search
Login
Register
CHDK forum
>
CHDK Development
>
General Discussion and Assistance
>
text file routines
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: text file routines (Read 781 times)
0 Members and 1 Guest are viewing this topic.
hiker_jon
Full Member
Offline
Posts: 154
text file routines
«
on:
13 / August / 2008, 17:54:33 »
Hi,
I would like to read and parse a text file. I notice that some basic routines (like fgets) are missing from the c library. Am I right? Should I write them myself? or has someone already done this.
What I want to do is read lines from a text file then do some simple parsing of the lines.
Thanks,
Jon
Logged
ewavr
Developers
Hero Member
Offline
Posts: 1053
A710IS
Re: text file routines
«
Reply #1 on:
13 / August / 2008, 18:24:39 »
-deleted-
«
Last Edit: 13 / August / 2008, 21:05:11 by ewavr
»
Logged
zeno
Sr. Member
Offline
Posts: 302
Re: text file routines
«
Reply #2 on:
13 / August / 2008, 18:42:02 »
I must be missing something - don't the script handling routines do something close to what you want? See script_load in core/script.c (and lib/ubasic/ubasic.c) for example.
Logged
reyalp
Guru Member
Offline
Posts: 2706
Re: text file routines
«
Reply #3 on:
13 / August / 2008, 21:00:00 »
Might be overkill, but you could also use lua for this
Say your text file has a bunch of
name=value
statements
create a lua state
lua_dofile your text file
getglobal on each name you are interested in.
delete you lua state.
there's a bunch of other ways you could do it too, but that's probably the most straightforward.
Logged
Don't forget what the
H
stands for.
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Using CHDK
-----------------------------
=> CHDK Releases
===> Microfunguy's Builds
===> Obsolete (Other Builds)
=====> MX3's (motion detection) Builds
=====> EWAVR's Builds
=====> Fingalo's Builds
=====> AllBest's Builds
=====> GrAnd's Builds
=> General Help and Assistance on using CHDK stable releases
===> Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
=> Script Writing
===> Completed and Working Scripts
===> LUA Scripting
=> RAW Shooting and Processing
=> Creative Uses of CHDK
-----------------------------
CHDK Development
-----------------------------
=> General Discussion and Assistance
===> Firmware Dumping
===> DryOS Development
===> DSLR CHDK development
=> Feature Requests
-----------------------------
Other Development
-----------------------------
=> Hotwire! Hardware Mods, Accessories and Insights
=> Non-CANON cameras development
-----------------------------
Lounge
-----------------------------
=> General Chat
=> Forum related issues
===> Archived Issues
Loading...