 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Nancy Guest
|
Posted: Sun Apr 29, 2007 8:18 pm Post subject: Would love FileWriteLine & FileDeleteLine functionality |
|
|
Hello,
GOD I love this application!!! I would also suggest putting a donation link on your main page. This program has made my life so much easier.
I've read through the documentation and found how you're doing the loop, read thing but it's a little too complex for me.
I like the simplicity of the FileReadLine function. I would like to replace all the fields in a comma delimited text file.
Thanks again,
Nancy |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5298
|
Posted: Sun Apr 29, 2007 9:52 pm Post subject: Is this not hard to notice? |
|
|
| Nancy wrote: | | Would love FileWriteLine & FileDeleteLine functionality |
Not many people notice the small-sized text of the post subject.  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10450
|
Posted: Mon Apr 30, 2007 1:37 am Post subject: |
|
|
| Better file operations are planned, but it might be a while. In the meantime, if you're stuck on anything specific trying searching the forum. If no luck there, try asking in the "Ask For Help" forum. |
|
| Back to top |
|
 |
Visioneer
Joined: 19 Nov 2007 Posts: 1
|
Posted: Fri Apr 18, 2008 5:08 pm Post subject: Delete keys from ini files |
|
|
Hi,
I would like to delete lines from ini files based on key values.
For example if keyName=C or keyName ends in C ie: keyName=YC
I do not know the keyName's in advance as they are dynamic and
there are many of them.
A feature such as Loop (ini) might be nice. Then I could get the key values, and based on that, do an IniDelete.
Anyway,
I see that Loop (read file contents) is slow and possible dangerous
as shown above, so I am thinking to do a FileRead, and then do a
Loop (parse a string) on `n, `r, and check if A_LoopField ends in "C"
and contains an "=" sign. If not I would append to a Collection var
such as, Collection = %Collection%%A_LoopField%`n`r. Then finally,
I would FileDelete my.ini file and FileAppend Collection to my.ini
This requires 1 disk read, 1 disk delete, and 1 disk write.
Is this a best and safe way to go?
What are the pitfalls? Bad sectors, memory full, disk full etc.
Should VarSetCapacity() play a part ?
Should the available CPU memory be checked against .ini file size?
Should a backup of .ini be made first and removed only if success
on final FileAppend?
For an ini file, is [`n`r] correct to put at each lines end.
How would I limit the process to only one [Section] ?
I guess StringLeft = [sectionName] could turn on function,
and next [whatever could turn it off.
This could maybe be a good #include function if it is made
bullet proof.
Thanks Chris
ps: How about a StringLike(string, value) function ?
How about a StringEnds(string, value) function
or: if string Like value
or: if string Ends value
ie: Does string start or end with this value.
This avoids having to create a var for a simple task,
and is easy. |
|
| Back to top |
|
 |
tomhansen
Joined: 27 Apr 2008 Posts: 4
|
Posted: Tue Apr 29, 2008 2:02 pm Post subject: |
|
|
Hi there
inserting a line would be quite useful for me. I have a file used purely for stringreplace functionality and it finishes like this
StringReplace, clipboard, clipboard,%A_Space%xxx, %A_Space%abc, All
sleep, 500
send ^v
return
So cannot just append new stringreplace line to file since it will then appear after the finishing commands. The file has hundreds of lines in it, but I would be quite happy to append to for example line 100 or whatever. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|