Results 1 to 4 of 4
Hello all,
Is there anyway to delete the first 6 characters on each line of a file using sed or awk? Thanks....
- 09-27-2007 #1Just Joined!
- Join Date
- Mar 2006
- Posts
- 25
sed & awk question
Hello all,
Is there anyway to delete the first 6 characters on each line of a file using sed or awk? Thanks.
- 09-27-2007 #2Just Joined!
- Join Date
- Aug 2007
- Posts
- 37
Here are two ways to do it with sed:
Code:sed 's/^......//' input_file sed 's/^.\{6\}//' input_file
- 09-27-2007 #3Just Joined!
- Join Date
- Mar 2006
- Posts
- 25
Thank you every much. You saved half of my working day.
- 09-28-2007 #4Linux User
- Join Date
- Aug 2006
- Posts
- 458
in awk
Code:awk '{print substr($0,7)}' file


Reply With Quote