Re: Remove the first 3 characters after reading each line



On 28 Sep 2006 09:33:24 -0700, nicetom786@xxxxxxxxx
<nicetom786@xxxxxxxxx> wrote:
Hi ,
I am new to unix .
I have a file to read and after reading each line I want to strip off
the first 3 characters and store in another variable.
Cut command cuts the first 3 characters but I do not how to get the
rest of letters.
For ex:
I have a line XXX_JOBNAME
Here is the code
cat jobs.txt |cut -c1-4
This prints XXXX_.
I want JOBNAME to be printed .But length of JOBNAME differs in each
line.

cat jobs.txt | cut -c5-
You don't need the cat; you could write
cut -c5- <jobs.txt


--
According to Kentucky state law, every person must take a bath at least
once a year.
.



Relevant Pages

  • Remove the first 3 characters after reading each line
    ... Cut command cuts the first 3 characters but I do not how to get the ... I want JOBNAME to be printed .But length of JOBNAME differs in each ... for line in `cat ~/jobs.txt` ... echo $line ...
    (comp.unix.programmer)
  • Remove the first 3 characters after reading each line
    ... Cut command cuts the first 3 characters but I do not how to get the ... I want JOBNAME to be printed .But length of JOBNAME differs in each ... for line in `cat ~/jobs.txt` ... echo $line ...
    (comp.unix.shell)
  • Re: Remove the first 3 characters after reading each line
    ... Cut command cuts the first 3 characters but I do not how to get the ... I want JOBNAME to be printed .But length of JOBNAME differs in each ... for line in `cat ~/jobs.txt` ... echo $line ...
    (comp.unix.programmer)
  • Re: Rita Mae Brown
    ... Rita Mae Brown has written many, many books on very diverse subjects. ... The cat mysteries written with Sneaky Pie Brown, ... However her animal characters and her plots ...
    (rec.pets.cats.anecdotes)
  • Re: Rita Mae Brown
    ... Rita Mae Brown has written many, many books on very diverse subjects. ... cat mysteries written with Sneaky Pie Brown, the female tiger she rescued, ... However her animal characters and her plots are ... superb in my opinion regarding her cat mysteries. ...
    (rec.pets.cats.anecdotes)