GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   removes newlines from textfiles (https://gfy.com/showthread.php?t=327232)

doornx 07-17-2004 06:04 AM

removes newlines from textfiles
 
Hmm..since this isn't an "i'd hit it" thread i'm not expecting to win an xbox for the longest thread of the week :Graucho

I have a dozen files and want to remove the newline (enter)
from them all..not by hand but batch wise

The newline is also the /n code but i can't seach/replace it for some reason since it somehow search for the exact same /n in the text

Would appreciate it if someone knows an editor/prog who can do this

( i can't code for shit so that won't be an option :winkwink: )

FuqALot 07-17-2004 06:17 AM

#!/usr/bin/perl
print "Content-type:text/html\n\n";
open(filex,"yourtextfile.txt");
@textfile = <filex>;
close(filex);
foreach $linex (@textfile) {
chomp($linex);
push(@text,$linex);
}
open(filex,">textfile.txt");
print filex @text;
close(filex);

quote the post if the code is looking funny.
something like this.

doornx 07-17-2004 06:21 AM

k thanks..i'll try something in perl or php since i couldn't find a regular editor who can do this strangely enough

Adultnet 07-17-2004 06:35 AM

Quote:

Originally posted by doornx
k thanks..i'll try something in perl or php since i couldn't find a regular editor who can do this strangely enough
good luck

Robertf 07-17-2004 06:36 AM

Editplus

You can use regular expression to ... search and replace :banana

doornx 07-17-2004 06:51 AM

Quote:

Originally posted by Robertf
Editplus

You can use regular expression to ... search and replace :banana

k checking it out thanks

doornx 07-17-2004 06:55 AM

Quote:

Originally posted by Robertf
Editplus

You can use regular expression to ... search and replace :banana

damn it works :thumbsup :thumbsup :thumbsup

thanks

Robertf 07-17-2004 07:02 AM

Quote:

Originally posted by doornx
damn it works :thumbsup :thumbsup :thumbsup

thanks

You're welcome :Graucho

sweet7 07-17-2004 07:51 AM

Quote:

Originally posted by Robertf
Editplus

You can use regular expression to ... search and replace :banana

:thumbsup


All times are GMT -7. The time now is 10:27 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123