10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
2. Shell Programming and Scripting
Platform : Oracle Linux 6.8
Shell : bash
I have a file which has lines like below. These are SELECT queries (SQL)
In each line, I want the word just after FROM keyword to be copied and printed on the top along with the word PROMPT.
The words after FROM clause below are table names. So, they... (6 Replies)
Discussion started by: John K
6 Replies
3. Shell Programming and Scripting
datafile:
2017-03-24 10:26:22.098566|5|'No Route for Sndr:RETEK RMS 00040 /ZZ Appl:PF Func:PD Txn:832 Group Cntr:None ISA CntlNr:None Ver:003050 '|'2'|'PFI'|'-'|'EAI_ED_DeleteAll'|'EAI_ED'|NULL|NULL|NULL|139050594|ActivityLog|
2017-03-27 02:50:02.028706|5|'No Route for... (7 Replies)
Discussion started by: SkySmart
7 Replies
4. Shell Programming and Scripting
Good day,
I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after.
file1:
file2:
Output:
I can match a regex and print the line and line after
awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } '
... (1 Reply)
Discussion started by: pathunkathunk
1 Replies
5. Shell Programming and Scripting
Hi all,
I have text file having a number P100. what i need is when i run a script, it should add 1 to the above number and append it to the next line of a same text file.. when i use the script next time it should check the last line and add 1 to the last number and so on..
like the text... (5 Replies)
Discussion started by: smarty86
5 Replies
6. Shell Programming and Scripting
Hi all,
I need to grep a line from a log file which ensures me that the application server script is executed successfully. Some body please help me on this.
I also need to write a while loop in which i need to use the status of the above grep output. Could some one please tell me how to use... (12 Replies)
Discussion started by: firestar
12 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I looking to use grep to return a string with exactly n matches.
I'm building off this:
ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '
-rwxr-xr-x 1 root root 632816 Nov 25 2008 vi
-rwxr-xr-x 1 root root 632816 Nov 25 2008 view
-rwxr-xr-x 1 root root 16008 May 25 2008... (7 Replies)
Discussion started by: MykC
7 Replies
8. UNIX for Dummies Questions & Answers
I have a folder with about 4000 files in it. I need to extract the files that contain a certain line of text to another directory.
for example files with 'ns1.biz.rr.com' need to be extracted to the directory above or some other directory.
I tried using the following but was not successful. (6 Replies)
Discussion started by: spartan22
6 Replies
9. Shell Programming and Scripting
Hi
I have an Input of following sort
AAAA:
ProgName="PROGRAM"
BBBB:
ProgName="BBBBBB"
CCCC:
DDDD:
ProgName="PROGRAM"
SSSS:
ProgName="PROGRAM"
ZZZZ:
ProgName="PROGRAM"
I want to find the Lines which are followed by ProgName="PROGRAM"
Out Put
AAAA: (11 Replies)
Discussion started by: pbsrinivas
11 Replies
10. Shell Programming and Scripting
I am wanting to automate a process that includes the step of appending to a filename a string of text that's contained inside the file. I.e. if filename A.fileA contains a string of text that reads 1234 after the phrase ABC, I want the shell script file to rename the file 1234_FileChecked_A.fileA.... (3 Replies)
Discussion started by: HLee1981
3 Replies