Aug 17, 2001 #1 mikeboz MIS May 18, 2000 41 US I want to print $4 to the end of the line. sample 32333r#1.mi 32333r#1 r#1 this is a description of the part output: this is a description of the part
I want to print $4 to the end of the line. sample 32333r#1.mi 32333r#1 r#1 this is a description of the part output: this is a description of the part
Aug 17, 2001 #2 vgersh99 Programmer Jul 27, 2000 2,146 US echo "32333r#1.mi 32333r#1 r#1 this is a description of the part" | cut -d' ' -f4- I had a very similar thread started a couple of hours ago on the related subject. I'd wonder how to do it purely in awk with NO NF/loop involved. vlad Upvote 0 Downvote
echo "32333r#1.mi 32333r#1 r#1 this is a description of the part" | cut -d' ' -f4- I had a very similar thread started a couple of hours ago on the related subject. I'd wonder how to do it purely in awk with NO NF/loop involved. vlad
Aug 17, 2001 Thread starter #3 mikeboz MIS May 18, 2000 41 US this is not so clean but, awk '{print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14}' file1 > file2 it works, dont know what kind of problems it may cause. Upvote 0 Downvote
this is not so clean but, awk '{print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14}' file1 > file2 it works, dont know what kind of problems it may cause.
Aug 17, 2001 #4 vgersh99 Programmer Jul 27, 2000 2,146 US this doesn't "cut" it - the poster needed a GENERIC solution - can't hard-wire the number of fields. vlad Upvote 0 Downvote
this doesn't "cut" it - the poster needed a GENERIC solution - can't hard-wire the number of fields. vlad
Aug 17, 2001 #5 flogrr Programmer May 4, 2000 142 US Here is one way. Not silver bullet elegant, however! nawk '{$1=$2=$3="";sub(" ",""print}' infile Note that assigning the null to the first three fields does not remove the FS associated with it, thus the sub function call. HTH flogrr flogr@yahoo.com Upvote 0 Downvote
Here is one way. Not silver bullet elegant, however! nawk '{$1=$2=$3="";sub(" ",""print}' infile Note that assigning the null to the first three fields does not remove the FS associated with it, thus the sub function call. HTH flogrr flogr@yahoo.com