DigitalIsBetter Posted May 28, 2008 Share Posted May 28, 2008 How do I remove the last linefeed in a file. This is how it looks 1 = Blah 2 = Blah 3 = Blah 4 = each line has a LF at the end 1 = Blah\n 2 = Blah\n 3 = Blah\n 4 = I want it to look like this 1 = Blah\n 2 = Blah\n 3 = Blah Thanks for the help. Link to comment Share on other sites More sharing options...
Aceguy Posted May 28, 2008 Share Posted May 28, 2008 is this an inifile.? [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
DigitalIsBetter Posted May 28, 2008 Author Share Posted May 28, 2008 (edited) is this an inifile.?no the numbers in the example are line numbers.the file when opened would actually look like thisBlahBlahBlah Edited May 28, 2008 by Learning Link to comment Share on other sites More sharing options...
nobbe Posted May 28, 2008 Share Posted May 28, 2008 you need to count the lines , then check if its last line , then replace the value something like this? $tal_text = StringReplace($tal_text, "\n", ""); $tal_text = StringReplace($tal_text, @CRLF, ""); $tal_text = StringReplace($tal_text, @LF, ""); $tal_text = StringReplace($tal_text, @CR, ""); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now