Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Why don't you pass 3 instead of Field3? Commented Mar 5, 2015 at 17:29
  • @cuonglm I just pasted an example to make it simpler to explain, in the actual file, the column headers are named differently and do not have the numeric suffix to them. Commented Mar 5, 2015 at 17:42
  • 1
    I mean if you pass the column number, it's easier awk -F'|' -v f=3 -v v=T 'FNR>1{$f=T}1' OFS='|' file Commented Mar 5, 2015 at 17:51
  • @cuonglm Thanks, yes it will make it easier. But the file has about 30 columns, and this script will be used as an utility for other users. So i wanted to make it simpler for them to use. Commented Mar 5, 2015 at 17:58