The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
File exists routine kamathg Shell Programming and Scripting 9 12-16-2008 04:56 AM
how to cp files to dir,using routine? wrapster Shell Programming and Scripting 4 05-21-2008 11:41 PM
how to cp files to dir,using routine? wrapster UNIX for Advanced & Expert Users 1 05-21-2008 03:18 PM
sub routine call sekar sundaram Shell Programming and Scripting 2 11-10-2005 08:30 PM
Entry Points Routine S.P.Prasad High Level Programming 9 10-21-2002 12:34 PM

 
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 04-21-2009
fwellers fwellers is offline
Registered User
  
 

Join Date: Mar 2008
Location: Northern, VA
Posts: 23
awk routine help

Hi,
I use awk but not as a programming language. Just generally in piplelines to split things out by fields.
I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out.

Lets say I have a file that contains database columns. The file looks like this:
col1
col2
col3
..

I want awk to go through that file and turn each line into an array element so that I can do a printf statement that would contain all the lines in the file in one statement. The statement would look something like this:

printf("%s,%s,%s\n", array[0],array[1],array[2])

Actually, I guess the array elements would be variablized also.

Is this a simple thing i can get some help with ?

Thanks,
Floyd
 

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 05:49 AM.


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