01-04-2008
parse multiple lines? should be a easy answer...
inputfile:
A B C D
E F G H
1 2 3 4
-----------
I want to read these and put them into a variable:
file=../inputfile
col2line1=`cat $file | awk '{print $2}'`
how do i extract row 2's E,F,G,H or row 3's 1,2,3,4???
I tried the search, didn't get much, maybe i suck at searching too
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some.
I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies
2. Shell Programming and Scripting
Hi,
I am having huge file with the following lines.
2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7.FPN, message={SD=2007:10:01:00:00:00:GMT,SP=5,NP=2,TS=2007:10:01:01:00:00:GMT,VP=0.0,TS=2007:10:01:01:30:00:GMT,VP=0.0}
2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7G.FPN,... (9 Replies)
Discussion started by: nathasha
9 Replies
3. Shell Programming and Scripting
I have a data file in the following format (refer to input file) with multiple lines containing some information. I need an output file to loop thorough the input file with summarized information as seen below (refer to output file) ‘Date Time' and ‘Beta Id' input file values should be concatenated... (7 Replies)
Discussion started by: shekharaj
7 Replies
4. Shell Programming and Scripting
Hi
I have a set of options in the form of key value in a file. Need to find a particular value of 'a' and delete all lines till the next 'a' keyword .
Ex :
a bbb
c ddd
e fff
g hhh
a sss
c ggg
e xxx
f sss
a ddd
d sss
r sss
g hhh (5 Replies)
Discussion started by: TDUser
5 Replies
5. Shell Programming and Scripting
Hello,
For the life of me, I can't figure out how to extract only certain lines of a file. For example, the file contains:
project.max-sem-ids
privileged 1.02K - deny -
system 16.8M max deny ... (2 Replies)
Discussion started by: PointyWombat
2 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I need help on the following req.
I am getting output of a command as follows:
16377612 total memory
3802460 used memory
2827076 active memory
681948 inactive memory
12575152 free memory
477452 buffer memory
I want to compute used... (1 Reply)
Discussion started by: mailsara
1 Replies
7. Shell Programming and Scripting
I have file which is having 500 lines. I want to get the first 100 lines then sleep, then again next 100 lines sleep so now till the end of the file.
Can someone tell me in perl and bash.
also i want to do it in threads.
Thanks.. (6 Replies)
Discussion started by: Anjan1
6 Replies
8. Shell Programming and Scripting
I have a tool which generates results in a file at every minute and which has following columns.
I need to create a script checks this file constantly and if Column ( QOM ) has value more then "30S" it should send an email.
Can anybody help ?
Thansk a lot.
Time MxML MxQD G P OIC OUC MDC... (11 Replies)
Discussion started by: jayeshpatel
11 Replies
9. Shell Programming and Scripting
What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is attached as well. Thank you :).
awk 'NR==2 {split($2,a,"");b=substr(a,1,length(a-1));print... (6 Replies)
Discussion started by: cmccabe
6 Replies
10. Shell Programming and Scripting
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
MKERRLST(1) General Commands Manual MKERRLST(1)
NAME
mkerrlst - create system error file
SYNOPSIS
mkerrlst [ -i inputfile ] [ -o outputfile ]
DESCRIPTION
Mkerrlst(1) creates error message files in the format described by syserrlst(5).
With no arguments mkerrlst creates the file /etc/syserrlst from the internal array sys_errlist.
Give just the -o option mkerrlst will create the file outputfile from the internal array sys_errlist.
Given just the -i option mkerrlst will create the file /etc/syserrlst from the input file inputfile.
Given both -i and -o options mkerrlst will create the error message file outputfile from the strings contained in inputfile.
NOTE: error messages are numbered from 0. If the error 0 does not have a message associated with it the first string in inputfile must
still be present.
RETURN VALUE
mkerrlst exits with status of 0 if no errors are encountered. If errors do occur an error message is printed on stderr and the exit status
is 1.
ERRORS
mkerrlst(1) can encounter any of the errors for the open(2), lseek(2), read(2), or write(2) system calls.
SEE ALSO
syserrlst(3) syserrlst(5)
HISTORY
mkerrlst(1), first appeared in 2.11BSD.
BUGS
Error messages can be a maximum of 80 characters.
3rd Berkeley Distribution March 14, 1996 MKERRLST(1)