Raised This Month: $ Target: $400
 0% 

Files: Deleting and check empty lines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-14-2006 , 13:55   Files: Deleting and check empty lines
Reply With Quote #1

First can you delete an empty line?

Code:
test0 test1 test2
to
Code:
test0 test1 test2

Second, how do you check for an emtpy line?
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 05-14-2006 , 13:57  
Reply With Quote #2

Short answer: You can't.
Long answer: You can, using Stream module, or the raw data mode of the new writing functions.

Checking for an empty line is as easy as simply checking to see if it equals ""
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-14-2006 , 13:59  
Reply With Quote #3

Quote:
Originally Posted by Twilight Suzuka
Checking for an empty line is as easy as simply checking to see if it equals ""
"^n" or "^r^n"
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 05-14-2006 , 14:11  
Reply With Quote #4

NO GREENBERET, BACK IN YOUR CAGE!

If you use the read_file native, its just "". If you use the others, it is ^n.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-14-2006 , 14:27  
Reply With Quote #5

read_file yes
other method is "^n" or "^r^n"
depends on the programm who created the file.
eg. the standart text editor from MS is using "^r^n"

btw. i dont like the cage
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 05-14-2006 , 14:29  
Reply With Quote #6

Yeah,t hats why we shove you in it. So you don't ask for more natives. XD
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-14-2006 , 21:40  
Reply With Quote #7

Quote:
Originally Posted by Twilight Suzuka
Short answer: You can't.
Long answer: You can, using Stream module, or the raw data mode of the new writing functions.

Checking for an empty line is as easy as simply checking to see if it equals ""
I see. Thanks
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-14-2006 , 22:24  
Reply With Quote #8

Or you could read a file write the lines you want to a temp file then delete the first file and rename the temp to the correct name
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Urahara
Member
Join Date: Apr 2006
Old 05-14-2006 , 23:26  
Reply With Quote #9

Ohayo Renji-san!
That is a horrible horrible way to do it ^^ *flicks fan*
__________________

Urahara's Shop is open! For all your needs:
http://urahara.amxmodx.org/forums/
Projects:
Ururu AntiCheat
MetaScript Library
Jinta Hax
Urahara is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-14-2006 , 23:54  
Reply With Quote #10

I never ever said it was efficient.
Possibly make a native for this?
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode