Possible Duplicate:
Truncate stdin line length?
I have been looking for an awk or perl (or maybe sed?) one-liner to print the first 80 char in a line to be used in as:
cat myfile.txt | # awk/perl here
I’m guessing something like perl -pe 'print $_[0..80]' should work but I’m no good in perl.
EDIT perl -pe 'print $_[0..80] does not work and I don’t know why. That’s why I asked this question. I feel like explaining after all those silent downvotes..
Also cat myfile.txt is just to demonstrate that the command should be in a pipe, I’m actually using some other output.
cut:
awk:
sed:
perl:
or:
grep: