The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
perl-like split function for bash? eur0dad Shell Programming and Scripting 5 09-05-2008 06:23 PM
Passing global variable to a function which is called by another function sars Shell Programming and Scripting 4 06-30-2008 11:39 AM
Split a file with no pattern -- Split, Csplit, Awk madhunk UNIX for Dummies Questions & Answers 10 12-17-2007 12:57 PM
perl split function new2ss Shell Programming and Scripting 5 06-08-2006 10:17 PM
split function ktsirig UNIX for Dummies Questions & Answers 4 09-29-2005 10:58 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 04-08-2008
fusionX fusionX is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 9
awk - split function

Hi,

I have some output in the form of:
#output:
abc123
def567
hij890
ghi324

the above is in one column, stored in the variable x ( and if you wana know about x... x=sprintf(tolower(substr(someArray[2],1,1)substr(userArray[1],3,1)substr(userArray[4],2,1)))

when i simply print x (print x) I get the above output. so it work.

I want to make an array of the above output so that each single username (abc123) is stored in a new array . (ex: usrArray[1]="abc123" and usrArray[2]="def567")

So I use the split function as:

split(x,usrArray,"\n");

well... when I print usrArray[1], instead of just giving me abc123, i get the same results of the variable x, or sometimes different ...

any help ?

regards
 

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 02:21 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