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.

3
  • 1
    If no fields were changed, this would not be an issue, but the code in the question does change the value of fields. The question is not about how to change the delimiter but how to retain it. Commented Apr 6 at 8:12
  • FS=OFS="," is about keeping the original separator by setting both separators the same value. However, when FS is implicit, awk sets OFS to " ", even if the field separator was virtually "\t". Commented Apr 6 at 21:10
  • 1
    My comment is about the fact that the question contains awk code that modifies a field, and you start out saying that OFS may be ignored if nothing is changed. If you want to comment on other answers, then do that in a comment. You can also edit or suggest edits to existing answers. When you answer , you will need to address the question, not other answers. Commented Apr 7 at 5:51