![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Replacement for sed | dbsurf | Shell Programming and Scripting | 0 | 01-25-2008 06:47 PM |
| Retrieve 5th Field to Last Field !! | jobbyjoseph | UNIX for Dummies Questions & Answers | 3 | 05-16-2007 04:20 AM |
| Moving Part of a field to another field using AWK | rjsha1 | Shell Programming and Scripting | 5 | 08-04-2006 06:39 AM |
| add increment field when first field changes | azekry | Shell Programming and Scripting | 2 | 11-14-2005 04:21 PM |
| cpu replacement. help | IMPTRUE | UNIX for Dummies Questions & Answers | 3 | 07-25-2003 09:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
field replacement
Hi,
I have a CSV file with around 1000 rows (lines) and 1000 columns (fields). I need to replace mth lines's nth field with a value. (E.g., 400th field of 300th line). how can i do that? Pl advise. Thanks Prvn |
|
||||
|
Thanks Vidhyadhar and era.
Era - when i used your solution, replacement done but "," also vanished. #cat /tmp/test 1,2,3 4,5,6 7,8,9 #gawk -F, -v line="2" -v col="2" 'NR == line { $col="value" }1' /tmp/test 1,2,3 4 value 6 7,8,9 # Vidhyadhar - when i ran your solution, o/p remains as acutal file contents (no replacements done). Thanks Prvn |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|