LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-17-2007, 12:51 AM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 45
awk: associative array key names


Hello.
Is there a way to get the keys of associative arrays in awk?
For eg: something like TCL's equivalent of [array names foo]?
Thanks.
 
Old 10-17-2007, 12:55 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,695
Blog Entries: 5

Rep: Reputation: 240Reputation: 240Reputation: 240
if i get you correctly

Code:
for (keys in array) print keys
or else, post a sample.
 
Old 10-17-2007, 12:58 AM   #3
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 45
That's precisely what I'm looking for.
Cool, thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Meta-key names in KDE Captain Tram Linux - Desktop 0 08-23-2006 01:43 PM
Perl: find array key by value bulliver Programming 2 04-06-2006 03:01 PM
exchange value and key per element in associative array rblampain Programming 3 04-02-2006 09:07 AM
using associative arrays corbis_demon Programming 0 01-25-2005 12:47 AM
How to return values into an array using awk Helene Programming 1 05-01-2004 10:05 PM


All times are GMT -5. The time now is 08:09 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration