For Programmers: Free Programming Magazines  


Home > Archive > AWK > February 2005 > update a column - all rows









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author update a column - all rows
kshave

2005-02-17, 3:59 pm

I have a fixed field length text file made up of 20 fields. One of the
fields (let's say field 16) is a 9 digit numeric field. I need to add a
constant value (eg. 100) to that column for every row.

(file before)
col1,col2....col15,101299300,col16..col20
col1,col2....col15,992123225,col16..col20

(file after)
col1,col2....col15,101299400,col16..col20
col1,col2....col15,992123325,col16..col20

What's the most efficient way to handle this? (The file is very large)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com