Go Back   Flash Flash Revolution > General Discussion > Technology
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 02-14-2013, 12:42 PM   #21
hi19hi19
lol happy
Retired StaffFFR Simfile AuthorFFR Veteran
 
hi19hi19's Avatar
 
Join Date: Oct 2005
Location: DESTINY
Age: 33
Posts: 12,193
Default Re: Website Design Hell

Quote:
Originally Posted by Reincarnate View Post
I hope you didn't fix that problem manually, hi19hi19 -- that can still be automated easy
Oh? Teach me. The only way I could think of also got rid of spaces in between the actual code too...

But no I found a copy of the page in a different folder (lol) that had no extra lines. It had no indentation in the code (also lol) but that took like 4 minutes to fix manually instead of 4 days.
__________________



Last edited by hi19hi19; 02-14-2013 at 01:14 PM..
hi19hi19 is offline   Reply With Quote
Old 02-14-2013, 02:47 PM   #22
UserNameGoesHere
FFR Veteran
FFR Veteran
 
UserNameGoesHere's Avatar
 
Join Date: May 2008
Posts: 1,114
Send a message via AIM to UserNameGoesHere
Default Re: Website Design Hell

Quote:
Originally Posted by hi19hi19 View Post
Oh? Teach me. The only way I could think of also got rid of spaces in between the actual code too...

But no I found a copy of the page in a different folder (lol) that had no extra lines. It had no indentation in the code (also lol) but that took like 4 minutes to fix manually instead of 4 days.
If you have access to a UNIX-like environment, from a command shell type prompt, do
Code:
sed -e 's/  \+/ /g' bad.html > good.html
It is assumed bad.html is the name of the original too many spaces HTML file and you want extra spaces stripped down to just a single space. good.html will be the same except have this spaces problem fixed.

You have no idea how batty I went trying to get that to work because apparently I had to "escape" the + modifier because I guess the shell was interpreting it before passing it to sed ... or something. I'm like why won't this work? It's a simple substitution .. lol. ...Then I'm like hmm let me try escaping the + ... BAM worked.
There are two spaces after the s/ and one space before the /g

--edit--

If, instead, you wish to convert all instances of too many spaces into newlines (for example, there are only tons of spaces where newlines should be but not elsewhere) then do this instead
Code:
sed -e 's/  \+/\n/g' bad.html > good.html
--edit2--

And if you're editing the file on multiple machines/environments it's possible the line endings can get pretty strange. If that happens, any decent text editor should be able to fix this for you (You need one which lets you select between Windows, Linux, and Mac line ending types .. choose to convert all to, say, Windows line ending format) and save the file.
__________________
Quote:
Originally Posted by Crashfan3 View Post
Man, what would we do without bored rednecks?
[SIGPIC][/SIGPIC]

Last edited by UserNameGoesHere; 02-14-2013 at 03:03 PM..
UserNameGoesHere is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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 Off
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:09 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution