For Programmers: Free Programming Magazines  


Home > Archive > AWK > March 2004 > R: bash to awk









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author R: bash to awk
davide moro

2004-03-19, 8:23 pm

> Here's one way:
>
> lineNrs="1 7 10"
> awk -v lineNrString="$lineNrs" 'BEGIN {
> split(lineNrString,i2LNs)
> for (i in i2LNs) lineNrs[i2LNs[i]] = i
> }
> NR in lineNrs { print }'
>
> Regards,
>
> Ed.
>


It's ok!
Thank you very much,

davide




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com