The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Finding the total of a column using awk ironhead3fan Shell Programming and Scripting 8 01-30-2009 06:59 AM
Deleting column from a flatfile with delimiter rsprabha Shell Programming and Scripting 5 10-03-2008 05:18 AM
Finding the most common entry in a column Donkey25 Shell Programming and Scripting 12 11-22-2007 12:16 PM
Adding field of flatfile by an index. djsal Shell Programming and Scripting 2 02-14-2007 12:53 PM
encrypting Unix flatfile rkumar28 UNIX for Dummies Questions & Answers 1 04-29-2004 10:31 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-07-2002
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Finding a column in a flatfile

I have a file which is fixed width columns. This is an offset buffer - rather than space or tab delimited. There are upto about 8 columns and I need to get all of the column 5's values into another file.

The problem is that because the delimiter is a space - and some fields are blank - the 5th field is sometimes taken as the 6th - so I lose quite a bit of data.

I want to find a way to output just the values from the 50th - 60th positions on the line into another file - for all lines in a large text file.

Ideally I'd like to get two columns for each line.....but I imagine that should be easy enough if I can figure out how to get the column I want.

I tried " awk -F" " '{print $5 "," $1 }' " - but this gives me the problem...any ideas?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0