awk tabbed delimited file parsing

  • Follow


I have a file containing data separated by tabs and it spans many
lines.  I want to extract only certain fields from each line. 
Example:

data1     data2     data3     data4
data5     data6     data7     data8
....
....

I want to extract data2,data4,data5 and data8 but the actual "data"
field may contain separate values (ie data2 = someString, data4 =
someInteger, data5 = 0123 and data8 = 6789.  I know that awk is
capable of this but don't know how.  Any comments and or suggestions
would be helpful.  Thanks, Monte.
0
Reply olveram7 9/7/2004 9:31:39 PM


monte wrote:
> I have a file containing data separated by tabs and it spans many
> lines.  I want to extract only certain fields from each line. 
> Example:
> 
> data1     data2     data3     data4
> data5     data6     data7     data8
> ...
> ...
> 
> I want to extract data2,data4,data5 and data8 but the actual "data"
> field may contain separate values (ie data2 = someString, data4 =
> someInteger, data5 = 0123 and data8 = 6789.  I know that awk is
> capable of this but don't know how.  Any comments and or suggestions
> would be helpful.  Thanks, Monte.

I think you need to at least provide a sample input and output file as 
that description could mean almost anything.

	Ed.
0
Reply Ed 9/8/2004 12:51:03 AM


1 Replies
250 Views

(page loaded in 0.044 seconds)

Similiar Articles:













7/24/2012 1:00:59 AM


Reply: