02-14-2013, 12:42 PM | #21 | |
lol happy
Join Date: Oct 2005
Location: DESTINY
Age: 33
Posts: 12,193
|
Re: Website Design Hell
Quote:
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.. |
|
02-14-2013, 02:47 PM | #22 | |
FFR Veteran
|
Re: Website Design Hell
Quote:
Code:
sed -e 's/ \+/ /g' bad.html > good.html 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 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.
__________________
[SIGPIC][/SIGPIC] Last edited by UserNameGoesHere; 02-14-2013 at 03:03 PM.. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|