## Selecting a line value

Selecting a line value
# 1
02-12-2008
Selecting a line value

Hello,

I just wanted to know if there is a way in UNIX to select a line value from a list of words. there is no line number before each word, hence could not use grep.
 unibboy View Public Profile for unibboy Find all posts by unibboy
# 2
02-12-2008
Quite hard to comprehend.

Could you please furnish sample input and desired output ?
# 3
02-12-2008
Assuming that you want to get the value of the list in a filie.
The below code gets the value of the first line in a file
Quote:
set -- head -1 $FILE | cat && VAR=$1
To get the value of the 5th line in afile
Quote:
set -- head -5 $FILE | tail -1 | cat && VAR=$1
 bobbygsk View Public Profile for bobbygsk Find all posts by bobbygsk
# 4
02-12-2008
@ bobbygsk

many thanks for the insight, it really did help
 unibboy View Public Profile for unibboy Find all posts by unibboy
# 5
02-12-2008
Perhaps it's more efficient to use sed. To print line 25:

Or with awk:

Regards
 Franklin52 View Public Profile for Franklin52 Find all posts by Franklin52

## Comparing two one-line files and selecting what does not match

I have two files. One is consisting of one line, with data separated by spaces and each number appearing only once. The other is consisting of one column and multiple lines which can have some numbers appearing more than once. It looks something like this: file 1: 20 700 15 30 file2: 10...

## Selecting groups

I have a file with contents like host1.domain.com:9090,host2.domain.com:9090,host3.domain.com:9090 I am looking for such an operation so that, the output should be host1.domain.com:9090 host2.domain.com:9090 host3.domain.com:9090 And also, if the number of entries are more, the...

## Help in selecting line numbers between two values

Hi! I've a file as shown below 1 hello 2 how 5 are 3 you 4 hello 5 world Every statement consists of line numbers at the beginning which are not in sequence. Now I want to select all the line numbers which are present between the line numbers specified by the user.. For example...

## Selecting specific line using awk

Hi, I would like to get the specific line from the file taking specific coloumn as reference. Thanks and Regards

## 8. Shell Programming and Scripting

Hello , i got text file like that' C:\Users\Public\Pictures\Sample Pictures\aa.jpg C:\Users\Public\Pictures\Sample Pictures\thumb.jpg C:\Users\Public\Pictures\vv\cc.jpg C:\Users\Public\Pictures\Sample Pictures\ee.jpg C:\Users\Public\aa\Sample Pictures\cvswsr.jpg...

## Selecting line ahead and next using AWK or SED

:confused: Good Day, I have this script that gets the archive names and the time it applies based on the alert log. The application of archives are of daily basis and usually many so having this script helps my job become easier. My problem is that when i get all the time stamps and...

## selecting a line and line above it.

hi..i have a file like the following Application handle = 2604 Application status = UOW Waiting Application handle = 2384 Application status = UOW Waiting Application handle ...