![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Subsrt ?
I have 7 fields, the last field is $7 and how do I write subsrt to get only
FieldActivity or FieldOrder or Case ex: type = FieldActivity ; it start at $7 and end at Modify ?? Thanks, LMWC|02/28/2006 00:19:42|||||FieldActivity Modify 10071 20072 30073 CXT9|02/28/2006 02:36:31|||||FieldActivity Modify 10171 20172 30173 CXT9|02/28/2006 02:21:31|||||FieldOrder Modify 10141 20142 JAKN|02/28/2006 00:40:08|||||Case Modify 10101 20102 30103 40104 |
| Forum Sponsor | ||
|
|
|
|||
|
Hi, i am not sure how substr does it, i have an awk version if that will help you.
Code:
#!/bin/bash
awk -F"[ |]" '{print "Type is:" $8}' $filename
#-F option sets <space> and <|> are separators. The 8th field is what you need.
|