Calling all nerds

Its bash script.. And I thought of SED as the first thing to use for this lol.. Not surprised someone solved that problem with it.. Brilliant tool.
 
Code:
cat file.txt | awk '{print $1,$2,$3}' > newfile.txt

or

Code:
sed -i 's/:.*/:/' file.txt
 
I vote sed or grok just to be utterly anal :D

Not heard of sed before but after looking at it seems a very useful and powerful tool. Had to download it via homebrew on osx as the pre-installed version is slightly broken being the POSIX variant rather than the GNU version.

But will give it a shot. Cheers. :)
 
Code:
cut -d" " -f 1-3 file1.txt > file2.txt

I normally use awk or sed but there are many ways to skin a cat. :)
 
Back
Top Bottom