Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Easy way to organize code (tags sorted by spaces)?
Old 04-30-2009, 05:21 PM Easy way to organize code (tags sorted by spaces)?
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
OK I have a project where the source code contains huge blocks of code with a few spaces in between the tags, for example:
HTML Code:
<table>
<tbody><tr>     <td class="tableRightAlign">Goeie mτre. </td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good morning.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie middag.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good afternoon.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie naand.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good evening.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie nag.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good night.</td>   </tr>   <tr>     <td class="tableRightAlign">Totsiens.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good bye.</td>   </tr>   <tr>     <td class="tableRightAlign">My naam is _(Jacques)_ .</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">My name is _____ .</td>   </tr>   <tr>     <td class="tableRightAlign">Waar kom u vandaan?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Where do you come from?</td>   </tr>   <tr>     <td class="tableRightAlign">Ek kom van _(Moskou)_ af.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I come from ____ .</td>   </tr>   <tr>     <td class="tableRightAlign">Ek gaan na Suid-Afrika toe.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I am going to South Africa.</td>   </tr>   <tr>     <td class="tableRightAlign">Wat is u naam?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">What is your name?</td>   </tr>   <tr>     <td class="tableRightAlign">Hoe gaan dit?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">How are you doing?</td>   </tr>   <tr>     <td class="tableRightAlign">Baie goed dankie en self?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Well thanks and yourself?</td>   </tr>   <tr>     <td class="tableRightAlign"> Nie te sleg nie dankie.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Not too bad thanks.</td>   </tr>   <tr>     <td class="tableRightAlign">Verskoon my asseblief.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Pardon me please.</td>   </tr>   <tr>     <td class="tableRightAlign">Hoe sκ 'n mens......?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">How does one say. . . . .?</td>   </tr>   <tr>     <td class="tableRightAlign">Mag ek Engels praat asseblief?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">May I speak English please?</td>   </tr>   <tr>     <td class="tableRightAlign">Nie te danke/Dis 'n plesier.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Only a pleasure.</td>   </tr>   <tr>     <td class="tableRightAlign">Ek is jammer.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I'm sorry.</td>   </tr>   <tr>     <td class="tableRightAlign">Ken julle mekaar?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Have you met? (Do you know each other?)</td>   </tr>   <tr>     <td class="tableRightAlign">Dis heerlike weer.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">It's lovely weather.</td>   </tr>   <tr>     <td class="tableRightAlign">Moenie so gaap nie.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Don't yawn like that.</td>   </tr>   <tr>     <td class="tableRightAlign">Slaap lekker.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Sleep tight.</td>   </tr>   <tr>     <td class="tableRightAlign">Veels geluk! (met...)</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Congratulations! (with...)</td>   </tr>   <tr>     <td class="tableRightAlign">Sterkte! </td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">All the best!/Good luck! (meaning: &quot;strength&quot;)</td>   </tr> </tbody>
</table>
So I'm curious if it's possible to sort it easily without going through each and every tag break, editing the spaces and pressing enter each time, like I did for this one:
HTML Code:
<table>
<tbody>
<tr>
<td class="tableRightAlign">Goeie mτre.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Good morning.</td>
</tr>
<tr>
<td class="tableRightAlign">Goeie middag.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Good afternoon.</td>
</tr>
<tr>
<td class="tableRightAlign">Goeie naand.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Good evening.</td>
</tr>
<tr>
<td class="tableRightAlign">Goeie nag.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Good night.</td>
</tr>
<tr>
<td class="tableRightAlign">Totsiens.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Good bye.</td>
</tr>
<tr>
<td class="tableRightAlign">My naam is _(Jacques)_ .</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">My name is _____ .</td>
</tr>
<tr>
<td class="tableRightAlign">Waar kom u vandaan?</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Where do you come from?</td>
</tr>
<tr>
<td class="tableRightAlign">Ek kom van _(Moskou)_ af.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">I come from ____ .</td>
</tr>
<tr>
<td class="tableRightAlign">Ek gaan na Suid-Afrika toe.</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">I am going to South Africa.</td>
</tr>
<tr>
<td class="tableRightAlign">Wat is u naam?</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">What is your name?</td>
</tr>
<tr>
<td class="tableRightAlign">Hoe gaan dit?</td>
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">How are you doing?</td>
</tr>
<tr>
<td class="tableRightAlign">Baie goed dankie en self?</td>     
<td class="tableMiddleColumn">•</td>
<td class="tableLeftAlign">Well thanks and yourself?</td>
</tr>   
<tr>     
<td class="tableRightAlign"> Nie te sleg nie dankie.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Not too bad thanks.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Verskoon my asseblief.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Pardon me please.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Hoe sκ 'n mens......?</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">How does one say. . . . .?</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Mag ek Engels praat asseblief?</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">May I speak English please?</td>   
</tr>  
<tr>     
<td class="tableRightAlign">Nie te danke/Dis 'n plesier.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Only a pleasure.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Ek is jammer.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">I'm sorry.</td>   
</tr>  
<tr>     
<td class="tableRightAlign">Ken julle mekaar?</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Have you met? (Do you know each other?)</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Dis heerlike weer.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">It's lovely weather.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Moenie so gaap nie.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Don't yawn like that.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Slaap lekker.</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Sleep tight.</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Veels geluk! (met...)</td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">Congratulations! (with...)</td>   
</tr>   
<tr>     
<td class="tableRightAlign">Sterkte! </td>     
<td class="tableMiddleColumn">•</td>     
<td class="tableLeftAlign">All the best!/Good luck! (meaning: &quot;strength&quot;)</td>   
</tr> 
</tbody>
</table>
I already tried wrapping the text, but that just changes it from one line to a large code block, you may have to copy and paste the first block to see what I mean.

I've got about 50 of these pages to do and just the first one was somewhat tedious.

I'm currently using notepad++, if it's possible with this program.
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
 
Register now for full access!
Old 04-30-2009, 07:12 PM Re: Easy way to organize code (tags sorted by spaces)?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I would think all the extra spaces will be the same each time out.

Copy one example of that extra space and then do a search and replace. Search for the space you copied and replace it with a line break. That will probably fix most of the code.

I forget what Notepads search and replace is like, but I think it has enough to do this. If not plenty of other free text editors do.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 04-30-2009, 07:24 PM Re: Easy way to organize code (tags sorted by spaces)?
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
The thing is though not all the tables are the same, some have different element properties and values, others have completely different data lengths. So not all the tables can be manipulated just the way one is (that I did to the first code block).

Notepad++ does have that feature though:
(Menu Bar) >> Search >> Replace
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 04-30-2009, 08:55 PM Re: Easy way to organize code (tags sorted by spaces)?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Do it in PHP!

PHP Code:
<?php
$subject_str 
'<table>
<tbody><tr>     <td class="tableRightAlign">Goeie mτre. </td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good morning.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie middag.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good afternoon.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie naand.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good evening.</td>   </tr>   <tr>     <td class="tableRightAlign">Goeie nag.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good night.</td>   </tr>   <tr>     <td class="tableRightAlign">Totsiens.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Good bye.</td>   </tr>   <tr>     <td class="tableRightAlign">My naam is _(Jacques)_ .</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">My name is _____ .</td>   </tr>   <tr>     <td class="tableRightAlign">Waar kom u vandaan?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Where do you come from?</td>   </tr>   <tr>     <td class="tableRightAlign">Ek kom van _(Moskou)_ af.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I come from ____ .</td>   </tr>   <tr>     <td class="tableRightAlign">Ek gaan na Suid-Afrika toe.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I am going to South Africa.</td>   </tr>   <tr>     <td class="tableRightAlign">Wat is u naam?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">What is your name?</td>   </tr>   <tr>     <td class="tableRightAlign">Hoe gaan dit?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">How are you doing?</td>   </tr>   <tr>     <td class="tableRightAlign">Baie goed dankie en self?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Well thanks and yourself?</td>   </tr>   <tr>     <td class="tableRightAlign"> Nie te sleg nie dankie.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Not too bad thanks.</td>   </tr>   <tr>     <td class="tableRightAlign">Verskoon my asseblief.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Pardon me please.</td>   </tr>   <tr>     <td class="tableRightAlign">Hoe sκ \'n mens......?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">How does one say. . . . .?</td>   </tr>   <tr>     <td class="tableRightAlign">Mag ek Engels praat asseblief?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">May I speak English please?</td>   </tr>   <tr>     <td class="tableRightAlign">Nie te danke/Dis \'n plesier.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Only a pleasure.</td>   </tr>   <tr>     <td class="tableRightAlign">Ek is jammer.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">I\'m sorry.</td>   </tr>   <tr>     <td class="tableRightAlign">Ken julle mekaar?</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Have you met? (Do you know each other?)</td>   </tr>   <tr>     <td class="tableRightAlign">Dis heerlike weer.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">It\'s lovely weather.</td>   </tr>   <tr>     <td class="tableRightAlign">Moenie so gaap nie.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Don\'t yawn like that.</td>   </tr>   <tr>     <td class="tableRightAlign">Slaap lekker.</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Sleep tight.</td>   </tr>   <tr>     <td class="tableRightAlign">Veels geluk! (met...)</td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">Congratulations! (with...)</td>   </tr>   <tr>     <td class="tableRightAlign">Sterkte! </td>     <td class="tableMiddleColumn">•</td>     <td class="tableLeftAlign">All the best!/Good luck! (meaning: &quot;strength&quot;)</td>   </tr> </tbody>
</table>'
;

$before = array("<"">");
$after = array("&lt;""&gt;");
$replace str_replace($before$after$subject_str);


$before = array("  ""&lt;/td&gt;""&lt;/tr&gt;""&lt;tr&gt;");
$after = array("""&lt;/td&gt;<br />""&lt;/tr&gt;<br />""&lt;tr&gt;<br />");
$replaceagain str_replace($before$after$replace);

echo 
$replaceagain;

?>
Now that code alone will output a clean, well-sorted string. For your other content, use the Search >> Replace in Notepad++ and replace all occurrences of ' with \' . Once you've pasted your replaced code in the $subject_str variable, you should be ready to go.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }

Last edited by stevej; 04-30-2009 at 09:21 PM..
stevej is offline
Reply With Quote
View Public Profile
 
Old 04-30-2009, 11:57 PM Re: Easy way to organize code (tags sorted by spaces)?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I thought you wanted to replace all the spaces with a new line. If so I don't see why the search I described would be a problem.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-01-2009, 12:32 AM Re: Easy way to organize code (tags sorted by spaces)?
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Steve A:
I don't have full access to the server, it's for an internship I'm working on with only access to a few sections of the CMS (Typo3).

Steve B:
I meant that the spacing number was different. Some have 4 spaces, others have 7, etc.

BTW, how do you tell it to line break? (I tried replacing one example with <br />, and that's all it does, not the same as pressing enter.)
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 05-01-2009, 12:58 AM Re: Easy way to organize code (tags sorted by spaces)?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Quote:
Originally Posted by jamestl2 View Post
Steve A:
I don't have full access to the server, it's for an internship I'm working on with only access to a few sections of the CMS (Typo3).
That's okay, the code is for conversion purposes only. You're supposed to copy-and-paste what it outputs (or that's what I had in mind, anyway).

Quote:
Originally Posted by jamestl2 View Post
I meant that the spacing number was different. Some have 4 spaces, others have 7, etc.
What the code does is replace any occurrence of 2 spaces with nothing. So it'll work with 4 or 7.

Quote:
Originally Posted by jamestl2 View Post
BTW, how do you tell it to line break? (I tried replacing one example with <br />, and that's all it does, not the same as pressing enter.)
Can you specify?

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 05-01-2009, 01:13 AM Re: Easy way to organize code (tags sorted by spaces)?
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
Quote:
Originally Posted by stevej View Post
That's okay, the code is for conversion purposes only. You're supposed to copy-and-paste what it outputs (or that's what I had in mind, anyway).
Where do you suggest I test the conversion script then? Like I said, I don't have full server access.

Quote:
Originally Posted by stevej View Post
Can you specify?
In Notepad++, all it does is replace the spaces with <br /> 's, it's not actually changing the format of the code.

I'm trying to make the code prettier in the source view, not what people see through their browsers.
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 05-01-2009, 01:23 AM Re: Easy way to organize code (tags sorted by spaces)?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Quote:
Originally Posted by jamestl2 View Post
Where do you suggest I test the conversion script then? Like I said, I don't have full server access.
Well, you could just install some local server like wamp to run the code...

Quote:
In Notepad++, all it does is replace the spaces with <br /> 's, it's not actually changing the format of the code.

I'm trying to make the code prettier in the source view, not what people see through their browsers.
Right. If you just run the code and then copy what it spits out, I think you'll be good to go.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 05-01-2009, 01:26 AM Re: Easy way to organize code (tags sorted by spaces)?
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
I do run some of my own websites .

I suppose I'll take a look with it and see what I can do on my hosting account then.

EDIT: It worked, thanks.

Just curious though if it could work with just Notepad++.
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects

Last edited by jamestl2; 05-01-2009 at 01:32 AM..
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 05-01-2009, 02:08 AM Re: Easy way to organize code (tags sorted by spaces)?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Glad it worked.

Quote:
Originally Posted by jamestl2 View Post
Just curious though if it could work with just Notepad++.
I'm not sure. I use Editplus, which (I think) is similar, so with some elaborate search and replace actions you might be able to clean it up.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 05-01-2009, 01:59 PM Re: Easy way to organize code (tags sorted by spaces)?
NullPointer's Avatar
Will Code for Food

Posts: 2,786
Name: Matt
Location: Irvine, CA
Trades: 0
I think you can do it with just notepad++. You can search and replace with a regular expression as the search string and \n as the replace string (I think).

This is unrelated, but steve, I just noticed that the code in your sig has no effect:

PHP Code:
if($stevej == "helpful") { $talkupation $user_power; } 
There's no left side to that expression, so $talkupation never actually increases

PHP Code:
if($stevej == "helpful") { $talkupation $talkupation $user_power; } 
OR

PHP Code:
if($stevej == "helpful") { $talkupation += $user_power; } 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-01-2009, 03:03 PM Re: Easy way to organize code (tags sorted by spaces)?
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Haha, thanks for that, Nullpointer. I'm not too good with operators (I'm not to sure why).

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 05-01-2009, 06:38 PM Re: Easy way to organize code (tags sorted by spaces)?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Guess I'm late to the solution. I was going to add the /n, but nullpointer beat me to it.

James it sounds like you've got this worked out then. Cool.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-05-2009, 01:31 PM Re: Easy way to organize code (tags sorted by spaces)?
kcmartz's Avatar
Super Talker

Latest Blog Post:
~Gri to Kcmartz~
Posts: 120
Name: Kenson
Location: Washington, USA
Trades: 0
Use Comments:

"
<!--Comment Here-->
"

Great for separating things!
__________________
Thanks,

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
for problems/site.
kcmartz is offline
Reply With Quote
View Public Profile Visit kcmartz's homepage!
 
Old 05-05-2009, 06:40 PM Re: Easy way to organize code (tags sorted by spaces)?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Did you read the thread? Your suggestion indicates you didn't.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-06-2009, 03:12 PM Re: Easy way to organize code (tags sorted by spaces)?
kcmartz's Avatar
Super Talker

Latest Blog Post:
~Gri to Kcmartz~
Posts: 120
Name: Kenson
Location: Washington, USA
Trades: 0
sorry, I was just suggesting that, it is really easy and good at seperating the tag areas...
__________________
Thanks,

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
for problems/site.
kcmartz is offline
Reply With Quote
View Public Profile Visit kcmartz's homepage!
 
Old 05-06-2009, 10:04 PM Re: Easy way to organize code (tags sorted by spaces)?
Brian07002's Avatar
Defies a Status

Posts: 2,141
Name: ...
Location: ...
Trades: 0
Organizing code tutorial 101:

Memorize what you do, so you don't have to sort / space etc..etc..Sometime I may write it out in a notepad doc before I start because sometimes my memory serves me bad.

Note: That is only so I can refer to a 'master plan' before I start coding it
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 05-06-2009 at 10:06 PM..
Brian07002 is online now
Reply With Quote
View Public Profile
 
Old 05-07-2009, 08:35 PM Re: Easy way to organize code (tags sorted by spaces)?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
@kcmartz - no worries and sorry if I came across harsh. Your advice is good. Just didn't apply here.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-08-2009, 12:41 PM Re: Easy way to organize code (tags sorted by spaces)?
kcmartz's Avatar
Super Talker

Latest Blog Post:
~Gri to Kcmartz~
Posts: 120
Name: Kenson
Location: Washington, USA
Trades: 0
Ok, thanks!

*Didn't mean to be off-topic, just trying to help with tag separation*
__________________
Thanks,

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
for problems/site.
kcmartz is offline
Reply With Quote
View Public Profile Visit kcmartz's homepage!
 
Reply     « Reply to Easy way to organize code (tags sorted by spaces)?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.62762 seconds with 12 queries