Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] W3C-Validator failed, wegen Sonderzeichen
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
Mac Fly
Guru
Guru


Joined: 30 Nov 2003
Posts: 330
Location: nähe Stuttgart

PostPosted: Sun Aug 14, 2005 7:02 pm    Post subject: [OT] W3C-Validator failed, wegen Sonderzeichen Reply with quote

Guten Tag,

ich lasse mit Pisg IRC-Statistiken erstellen. Und jetzt hab ich nach jeder Action ("/me macht irgendwas"), ein komisches Sonderzeichen.
Nachzuschauen unter: http://validator.w3.org/check?uri=http%3A%2F%2Fgerman-bash.org%2Faction%2Firc_stats

Wie kann ich mit sed nach diesem Zeichen suchen? Copy and paste funktioniert leider nicht.

Any Hints?
Back to top
View user's profile Send private message
Raistlin
l33t
l33t


Joined: 17 May 2004
Posts: 691
Location: Boston, MA

PostPosted: Mon Aug 15, 2005 9:33 am    Post subject: Reply with quote

Ja, das ist wirklich komisch... Anscheinend (link) heisst das Zeichen "Diamond". ASCII Code ist 4 (link), welcher gleich ist wie ETO (End Of Transmission) (link)...

Hth.

Gruss, R.
_________________
Zwei Was Eins Initially

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
Back to top
View user's profile Send private message
Mac Fly
Guru
Guru


Joined: 30 Nov 2003
Posts: 330
Location: nähe Stuttgart

PostPosted: Mon Aug 15, 2005 10:08 am    Post subject: Reply with quote

Vielen Dank, schon einen Schritt weiter.

Aber wie bekomme ich dieses Zeichen denn nun mit sed zu fassen?
Back to top
View user's profile Send private message
Mac Fly
Guru
Guru


Joined: 30 Nov 2003
Posts: 330
Location: nähe Stuttgart

PostPosted: Mon Aug 15, 2005 11:30 am    Post subject: Reply with quote

Es ist Zeichen 1, nicht 4.
Und ich hab herausgefunden, wie es geht:
Code:
sed -e "s/\o01//g"


Trotzdem vielen Dank :)


Last edited by Mac Fly on Mon Aug 15, 2005 8:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fabiolla
Apprentice
Apprentice


Joined: 04 Mar 2004
Posts: 277
Location: somewhere

PostPosted: Mon Aug 15, 2005 11:32 am    Post subject: Reply with quote

Hallo,

Ascii Zeichen können durch 2 Möglichkeiten in regulären Ausdrücken erfasst werden.

a) Mit Hex-Code, als Escape dient ein \x
b) Mit Ascii-Code, als Escape dient ein \d

Beispiel zu Hex-Code

Quote:

Es gibt eine Datei mit folgenden Inhalt : AAAaaaa
x41 ist der Hex-Code für A (kann mit showkey -a ermittelt werden)

cat test.txt | sed -e 's/\x41/@/g' liefert @@@aaaa



Beispiel zu Ascii Code

Quote:

Es gibt eine Datei mit folgenden Inhalt : AAAaaaa
65 und 97 sind die Ascii-Codes

cat test.txt | sed -e 's/\d65/@/g' liefert @@@aaaa
cat test.txt | sed -e 's/\d97/@/g' AAA@@@@



lg
Back to top
View user's profile Send private message
Mac Fly
Guru
Guru


Joined: 30 Nov 2003
Posts: 330
Location: nähe Stuttgart

PostPosted: Mon Aug 15, 2005 8:30 pm    Post subject: Reply with quote

Super, Vielen Dank :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum