Sponsored Content
Full Discussion: help
Top Forums Shell Programming and Scripting help Post 302129580 by matrixmadhan on Tuesday 31st of July 2007 03:13:26 PM
Old 07-31-2007
Quote:
He has a file with 9 (nine) columns and wants to replace the 4th column.

Your test data has 17 columns, much more than 9 columns.

Also the 'A' in your test data is on the 7th column, not the 4th column.
Confusion here !

I assumed data value separated by spaces

data1 space data2 space .... data<n>

something like that.

If the file format is different just by tuning the solution to the needs it should work Smilie
 
COLRM(1)						    BSD General Commands Manual 						  COLRM(1)

NAME
colrm -- remove columns from a file SYNOPSIS
colrm [start [stop]] DESCRIPTION
The colrm utility removes selected columns from the lines of a file. A column is defined as a single character in a line. Input is read from the standard input. Output is written to the standard output. If only the start column is specified, columns numbered less than the start column will be written. If both start and stop columns are spec- ified, columns numbered less than the start column or greater than the stop column will be written. Column numbering starts with one, not zero. Tab characters increment the column count to the next multiple of eight. Backspace characters decrement the column count by one. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of colrm as described in environ(7). EXIT STATUS
The colrm utility exits 0 on success, and >0 if an error occurs. SEE ALSO
awk(1), column(1), cut(1), paste(1) HISTORY
The colrm command appeared in 3.0BSD. BSD
August 4, 2004 BSD
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy