Digital Paint Discussion Board

Digital Paint Community => Other Stuff => Topic started by: ic3y on June 10, 2011, 06:28:26 PM

Title: Linux command
Post by: ic3y on June 10, 2011, 06:28:26 PM
Hello, maybe someone can help me.

I have a text file called ip.txt
In this file are ips =O

As Example
Code: [Select]
[13:07:51] newbie connected [91.22.217.218:7516]
[13:07:51] newbie@@@u)=( connected [121.220.206.117:11086]

How I can delete the first part?
I need just this part

Code: [Select]
newbie connected [91.22.217.218:7516]
newbie@@@u)=( connected [121.220.206.117:11086]

Greetz ic3y
Title: Re: Linux command
Post by: Gamabunta on June 10, 2011, 06:47:20 PM
Code: [Select]
cat ip.txt | cut -c 12-100I think that 100 is enough, might not be the best approach but it works.

Edit:
Oh, and if you want to save the output to another file, try:
Code: [Select]
cat ip.txt | cut -c 12-100 | cat > ip2.txtor
Code: [Select]
cat ip.txt | cut -c 12-100 | cat >> ip2.txtWhere ">" overrides specified file, and ">>" adds lines to existing file.
Title: Re: Linux command
Post by: ic3y on June 11, 2011, 05:11:40 AM
Hm, I had it like this, but now it works.
I had problems with the "cut" part.
Ty Gama
Title: Re: Linux command
Post by: XtremeBain on June 13, 2011, 01:30:55 PM
*head explodes*

Code: [Select]
cut -d' ' -f2- ip.txt > ip.$$ && mv ip.$$ ip.txt