Hi
I am writing a shell script in which I have to search all records
which are dated 02/24/2005. The file consists of date in mm/dd/yyy format and corresponding job name.
When I tried to use awk /"$1"/ filelist where $1 is input date e.g 02/24/2005 , it gives an error .
I want to... (2 Replies)
Hi,
I am new to ksh scripting and I have a problem.
I have a file in which I have to search for a particular pattern say 'a' then from that line I need to search for another pattern say 'b' in the previous lines and thne print the file from pattern 'b' till the end of file.
For eg:
... (2 Replies)
Hi,
I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file.
... (11 Replies)
Hi, I am not sure if this will work or not. I am getting a syntax error.
I am reading fileA, using an acct number field trying to see if it exists in fileB and output to new file. Can anyone tell me if what I am doing will work or should I attempt it another way? Thanks.
exec < "${fileA}... (4 Replies)
Hi,
I am having a user.txt contains the name of users and passwd.txt file contains as passwd.txt
$cat usr.txt
root
bin
daemon
cap
$cat passwd.txt
root:x:0:0:root:/root:/usr/bin/ksh
bin:x:1:1:bin:/bin:/sbin/csh
daemon:x:2:2:daemon:/sbin:/usr/bin/ksh
adm:x:3:4:adm:/var/adm:/sbin/nologin... (4 Replies)
Hello everyone!!
I need help with this please:
I have a file with this content:
56977964333 730030201857822 1
2
4
56976969284 730030201412442 1
2... (3 Replies)
I have the following code as a file which a user can choose with an option to search in that file. The file name is not specified and can have any name and extension. Now a sample of this file is like this:
1,root,init,20,0.0,0.1,0:01.78
1008,root,migration/0,1,2.0,1.8,7:04.32... (4 Replies)
Here Is a problem I am facing with awk.
Query --> I want to search for a string in a file and print next 15 lines below the matched string.
1.We do not have GNU grep so cannot use grep -A or grep -B commands.
2. Instead of passing the search pattern as a string to awk. I want the awk to... (4 Replies)
Hello,
Some time ago a helpful awk file was provided on the forum which I give below:
NR==FNR{A=$0;next}{for(j in A){split(A,P,"=");for(i=1;i<=NF;i++){if($i==P){$i=P}}}}1
While it works beautifully on English and Latin characters i.e. within the ASCII range of 127, the moment a character beyond... (6 Replies)
I would like to grep for aaa and bbb and ccc from one line in file1.txt in any order on a line on file2.txt
file1.txt
aaa bbb ccc
ddd fff ggg
hhh ddd jjj
jjj cccfile2.txt
aaa bbb ccc ddd fff ggg --> output whole line since it matches with aaa bbb ccc of file1.txt
aaa ddd jjj hhh --> no... (1 Reply)