![]() |
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: ) |
#!/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. |
k thanks..i'll try something in perl or php since i couldn't find a regular editor who can do this strangely enough
|
Quote:
|
Editplus
You can use regular expression to ... search and replace :banana |
Quote:
|
Quote:
thanks |
Quote:
|
Quote:
|
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