Source language: Translate to:

File delete line

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

File delete line

Postby Wrangler » Thu Feb 14, 2008 6:01 pm

Don't know if this has been suggested before.

Right now FileDelLine requires a line number. Would be good if you could enter a variable, and it will find a line that matches, and delete it.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Fri Feb 15, 2008 6:36 am

Wrangler:
Would be good if you could enter a variable, and it will find a line that matches, and delete it.
a) Exact match ... or (partial) match anywhere in a line ?

b) first matching line or all matching lines ?


If the file is not too big ... you could ...

- read the entire file into a [variable]
- add [#13][#10] at beginning and end of [variable]
- do a SearchStr to find the line you want ... append [#13][#10] before/after the desired text so you don't find lines with partial desired text
- when found, use resulting position and length of SearcStr to StrDelete the desired Text
- repeat above step if you want to remove ALL matching lines
- remove any remaining [#13][#10] if still tere at beginning/end of file
- FileWrite modified [variable] back to file
User avatar
Gaev
 
Posts: 3735
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Wrangler » Fri Feb 15, 2008 9:10 am

a) Exact match ... or (partial) match anywhere in a line ?


Maybe an option for "contains" or "matches".

b) first matching line or all matching lines ?


Maybe an option for "first" or "all.

I know how to code for it. It seems a lot of unnecessary code if this action could do it. Seems it would fit into the "no programming skills required" theme, and save those of us with programming skills some code writing to boot.

I think there are other actions that are also just too basic, and could be enhanced. This just happened to be one I was farting with yesterday. I had written a database name to a file, and when the database is deleted, I wanted to remove the name from the file. A task this easy shouldn't require 5 lines of code. Just add some options to this action, much like the filewrite action, and it's done.

That was my suggestion.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby HPW » Fri Feb 15, 2008 9:45 am

hpwLineNumber from hpwControl would give you the line-number.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Wrangler » Fri Feb 15, 2008 10:02 am

Thanks, Hans. I'm using your plug to get the job done now. But I'm not using any other actions in your plug, so it seems unecessary to bloat my exe with another plugin used just for one action. I just think commands like this should be native to neobook.

As it is right now, your plug saved the day, and made it easy for me to accomplish this task. I thank you for that contribution.

Another one I'd like to see is SearchFile. And FileSize, and FolderSize. Pretty basic actions that won't slow neobook down if implemented. Just make life a lot easier, and more attractive to those who aren't Neobook "power users". :wink:
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Fri Feb 15, 2008 10:24 am

Wrangler:
Another one I'd like to see is SearchFile. And FileSize ...
Take a look at FileSize command ... don't know when Dave slipped this into native NeoBook.
User avatar
Gaev
 
Posts: 3735
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Wrangler » Sat Feb 16, 2008 10:52 am

Gaev: Yes. You're right. It got by me too. I've been using Ronnie's plug all this time. :shock:

Retract the filesize statement.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron