Digital Paint Discussion Board
Digital Paint Community => Other Stuff => Topic started 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
[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
newbie connected [91.22.217.218:7516]
newbie@@@u)=( connected [121.220.206.117:11086]
Greetz ic3y
-
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:
cat ip.txt | cut -c 12-100 | cat > ip2.txtor
cat ip.txt | cut -c 12-100 | cat >> ip2.txtWhere ">" overrides specified file, and ">>" adds lines to existing file.
-
Hm, I had it like this, but now it works.
I had problems with the "cut" part.
Ty Gama
-
*head explodes*
cut -d' ' -f2- ip.txt > ip.$$ && mv ip.$$ ip.txt