List second line entries


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List second line entries
# 8  
Old 03-14-2012
Quote:
Originally Posted by itkamaraj
Code:
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}' mylist.txt
sara phill mike bob 
tala  ali zula


can you please help me to print the output as

Code:
 
sara
phill
mike 
bob 
tala
ali 
zula

# 9  
Old 03-14-2012
Code:
 
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}' mylist.txt | tr " " "\n"
sara
phill
mike
bob
tala
ali
zula

This User Gave Thanks to itkamaraj For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List files output only for the last line

Hi, "ls -tl directory1" will list files to be sorted in mtime, but I don't want to see all the files in each directory, I want to only see output the last line (the oldest mtime) for each directory. $ ls -tl test1 -rw-r--r-- 1 hce hce 1714397 May 30 2013 b.txt -rw-r--r-- 1 hce hce 4678 May... (2 Replies)
Discussion started by: hce
2 Replies

2. UNIX for Dummies Questions & Answers

List into one line?

Probably, something really easy to do and stupid to ask help with it, but how to turn a list of numbers into one line of numbers. I have: , 116332682 , 116332683 , 116332685 , 116332686 , 116332687 , 116332688 , 116332689 ,... (6 Replies)
Discussion started by: Iifa
6 Replies

3. Shell Programming and Scripting

Print pipe separated list as line by line in Korn Shell

Korn Shell in AIX 6.1 I want to print the below shown pipe (|) separated list line by line. line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883 for i in line do echo "Hello $line " done I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies

4. Shell Programming and Scripting

turn list into one line

Hi All i am cat'ing a file and then using cut to get rid of some info, is there a way to turn the list into one line i.e 1 2 3 4 5 into 1 2 3 4 5 (4 Replies)
Discussion started by: ab52
4 Replies

5. UNIX for Dummies Questions & Answers

Appending lines from an existing list to each line in another existing list

Evening all ! I would like to ask your expertise on how to accomplish the following ; I have 2 lists, and would like each line from list2 to be appended to each line in list1, resulting in list3 ; List1; alpha beta charlie List2; one two three (4 Replies)
Discussion started by: TAPE
4 Replies

6. Shell Programming and Scripting

Create list in command line

How do you create lists or arrays in the command line? And how do you access specific cells of the list? (1 Reply)
Discussion started by: locoroco
1 Replies

7. Shell Programming and Scripting

how do I list my values one per line instead of across it?

I want to list my vars in a script so they look like while read IN var1 var2 var3 var4 do echo $IN done Then in the same script have them read and processed. the closest I can get is as follows but this is obviously wrong. NOTE I want a list not all the entries on one line, that... (5 Replies)
Discussion started by: pobman
5 Replies

8. UNIX and Linux Applications

Need to list pattern only not containing whole line

I am searching a pattern item_id>000111111</item_id> in an XML file. More than one occurance are there for this patter in a single line. I have tried awk '/item_id/,/item_id/' tpnb1.txt>abc.txt Full lines containg pattern are coming. I need only list of 000111111. (1 Reply)
Discussion started by: tredev
1 Replies

9. Shell Programming and Scripting

i want to list all command line arguments except

Hi all i want to list out all command line arguments except $1 i have passed to a script. Ex: sh cmdline.sh one two three four five o/p: two three four five (3 Replies)
Discussion started by: naree
3 Replies

10. UNIX for Dummies Questions & Answers

converting a list into a line

Hi, this is a pretty intersting problem, I would like to convert a list of words into a concatenated string of words with whitespace between each word. e.g file list :- hello how are you today convert into hello how are you today. What command would I use to do this? Thanks (2 Replies)
Discussion started by: zulander
2 Replies
Login or Register to Ask a Question