PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Kleines sourcecode Problem



visitor
19.07.04, 20:42
Hallo Leute, ich habe ein problem ..

Ich möchte einen sourcecode a la ..



<table style="border: 1px solid #333333;}" width="950" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border-right: 1px solid #333333;}" width="50" bgcolor="#CAAB76">&nbsp;</td>
<td width="900" bgcolor="#EBCA87"><table width="875" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" style="border-bottom: 2px dotted #333333;}">&nbsp;</td>
</tr>
<tr>
<td><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr>


in soetwas umwandeln:



<table style="border: 1px solid #333333;}" width="950" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border-right: 1px solid #333333;}" width="50" bgcolor="#CAAB76">&nbsp;</td>
<td width="900" bgcolor="#EBCA87"><table width="875" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" style="border-bottom: 2px dotted #333333;}">&nbsp;</td>
</tr>
<tr>
<td><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr>


Dazu benutze ich folgenden Syntax .. :%s/^ *//g

Wie zum teufel bekomme ich aber Foltlaufende Zeilennummern vor die Zeilen, also in etwa so:



Zeile1=<table style="border: 1px solid #333333;}" width="950" border="0" cellspacing="0" cellpadding="0">
Zeile2=<tr>
Zeile3=<td style="border-right: 1px solid #333333;}" width="50" bgcolor="#CAAB76">&nbsp;</td>
Zeile4=<td width="900" bgcolor="#EBCA87"><table width="875" border="0" cellspacing="0" cellpadding="0">
.......
Zeile105=<tr>
Zeile106=<td valign="middle" style="border-bottom: 2px dotted #333333;}">&nbsp;</td>
Zeile107=</tr>
Zeile108=<tr>
.......
Zeile999=<tr>



MFG
visitor

kth
19.07.04, 22:52
nl -ba -fa -ha -nln -p -s= -w1 alteDatei | sed 's/^/Zeile/' >neueDateinl ist Bestandteil der coreutils.

visitor
19.07.04, 23:03
Vielen Dank, ich stehe in deiner Schuld ;)

MFG
visitor