Using awk or sed need the output in the new file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Using awk or sed need the output in the new file
# 1  
Old 03-08-2012
Java Using awk or sed need the output in the new file

Please find the input file as given below:

2012/02/29 11:00:00~~CRITICAL~For customer 00000476 no daily files were found in the 010137933 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05006802 no daily files were found in the 010115166 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05011563 no daily files were found in the 010140474 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05020228 no daily files were found in the 010138125 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05020386 no daily files were found in the 010139358 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05021824 no daily files were found in the 010139517 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05021842 no daily files were found in the 010138341 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05021900 no daily files were found in the 010172283 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05021919 no daily files were found in the 010139104 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05022009 no daily files were found in the 010140344 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05022069 no daily files were found in the 010138079 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05022200 no daily files were found in the 010142552 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05022340 no daily files were found in the 010146237 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05022434 no daily files were found in the 010146543 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-11KRBM no daily files were found in the 010140084 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-135C5 no daily files were found in the 010146694 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-1YMM0B no daily files were found in the 010143465 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-2U4KZF no daily files were found in the 010140158 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-4IL79 no daily files were found in the 010140476 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-4IL79 no daily files were found in the 010142047 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-4IL79 no daily files were found in the 010146576 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-76T0K1 no daily files were found in the 010145539 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-7EM9AA no daily files were found in the 010146683 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-BWM-187 no daily files were found in the 010143241 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-BWM-187 no daily files were found in the 010143252 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-BWM-244 no daily files were found in the 010143733 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-BWM-252 no daily files were found in the 010144781 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 1-PC-975 no daily files were found in the 010146170 account directory.

I need the below output in a different file using the above input file as a command line argument. The line count in the input file may vary it may increase or decrease. The fourth and twelfth columns from the input file are needed to produce the below output (Ex: cp /ratingup/4th column/D* /cdr/12th Column/cdr &). Please help me ASAP

cp /ratigup/010137933/D* /cdr/00000476/cdr &
cp /ratigup/010115166/D* /cdr/05006802/cdr &
cp /ratigup/010140474/D* /cdr/05011563/cdr &
cp /ratigup/010138125/D* /cdr/05020228/cdr &
cp /ratigup/010139358/D* /cdr/05020386/cdr &
cp /ratigup/010139517/D* /cdr/05021824/cdr &
cp /ratigup/010138341/D* /cdr/05021842/cdr &
cp /ratigup/010172283/D* /cdr/05021900/cdr &
cp /ratigup/010139104/D* /cdr/05021919/cdr &
cp /ratigup/010140344/D* /cdr/05022009/cdr &
cp /ratigup/010138079/D* /cdr/05022069/cdr &
cp /ratigup/010142552/D* /cdr/05022200/cdr &
cp /ratigup/010146237/D* /cdr/05022340/cdr &
cp /ratigup/010146543/D* /cdr/05022434/cdr &
cp /ratigup/010140084/D* /cdr/1-11KRBM/cdr &
cp /ratigup/010146694/D* /cdr/1-135C5/cdr &
cp /ratigup/010143465/D* /cdr/1-1YMM0B/cdr &
cp /ratigup/010140158/D* /cdr/1-2U4KZF/cdr &
cp /ratigup/010140476/D* /cdr/1-4IL79/cdr &
cp /ratigup/010142047/D* /cdr/1-4IL79/cdr &
cp /ratigup/010146576/D* /cdr/1-4IL79/cdr &
cp /ratigup/010145539/D* /cdr/1-76T0K1/cdr &
cp /ratigup/010146683/D* /cdr/1-7EM9AA/cdr &
cp /ratigup/010143241/D* /cdr/1-BWM-187/cdr &
cp /ratigup/010143252/D* /cdr/1-BWM-187/cdr &
cp /ratigup/010143733/D* /cdr/1-BWM-244/cdr &
cp /ratigup/010144781/D* /cdr/1-BWM-252/cdr &
cp /ratigup/010146170/D* /cdr/1-PC-975/cdr &

Thanks & Regards
Vikas Sagar

Moderator's Comments:
Mod Comment Double post, continued here
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies

2. Shell Programming and Scripting

Output on one line using awk or sed

I have a file of 100,000 lines in the below format: answer.bed chr1 957570 957852 NOC2L chr1 976034 976270 PERM1 chr1 976542 976787 PERM1 I need to get each on one line and so far what I have tried doesn't seem to be working. Thank you... (3 Replies)
Discussion started by: cmccabe
3 Replies

3. Shell Programming and Scripting

Use of awk/sed to filter out fdisk output

Hi , I am trying to filter out the below output of fdisk -l command : fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 ... (9 Replies)
Discussion started by: omkar.jadhav
9 Replies

4. Shell Programming and Scripting

Problem with output awk and sed

I have file, i am extracting email address from file. but problem is that output is very ugly. I am using this command REMOVED "CSS OFFENDING CODE"... While original filename have no such character. Please suggest. (20 Replies)
Discussion started by: learnbash
20 Replies

5. Shell Programming and Scripting

Want to sort a file using awk & sed to get required output

Hi All, Need Suggestion, Want to sort a file using awk & sed to get required, output as below, such that each LUN shows correct WWPN and FA port Numbers correctly: Required output: 01FB 10000000c97843a2 8C 0 01FB 10000000c96fb279 9C 0 22AF 10000000c97843a2 8C 0 22AF 10000000c975adbd ... (10 Replies)
Discussion started by: aix_admin_007
10 Replies

6. Shell Programming and Scripting

Pipe awk's output to sed for deletion

Hi Friends, I am using a command that prints certain lines from a file. For ex: cat input abc chr1 456 def chr1 789 ghi chr1 999 jjj chr1 777 jhk chr7 914 My command awk '{if($2=="chr1" && $3>=456 && $3<=999) {print $0}}' OFS="\t" input Output being printed is abc chr1 456 (7 Replies)
Discussion started by: jacobs.smith
7 Replies

7. Shell Programming and Scripting

Help needed with file output awk sed command - please

Hi I have a file that contains lines starting with a particular string plus a Colon: I need to output all these lines but only what comes after the colon Can you pelase assist? Example of lines in the file: com.ubs.f35.cashequities/cashequities: 1 2 ... (5 Replies)
Discussion started by: mnassiri
5 Replies

8. Shell Programming and Scripting

need awk or sed help to reformat output

We have the following output: server1_J00_data_20120711122243 server1_J00_igs_20120711122243 server1_J00_j2ee_20120711122243 server1_J00_sec_20120711122243 server1_J00_data_20120711131819 server1_J00_igs_20120711131819 server1_J00_j2ee_20120711131819 server2_J00_data_20120711122245... (10 Replies)
Discussion started by: ux4me
10 Replies

9. Shell Programming and Scripting

To parse through the file and print output using awk or sed script

suppose if u have a file like that Hen ABCCSGSGSGJJJJK 15 Cock ABCCSGGGSGIJJJL 15 * * * * * * : * * * . * * * : Hen CFCDFCSDFCDERTF 30 Cock CHCDFCSDHCDEGFI 30 * . * * * * * * * : * * :* : : . The output shud be where there is : and . It shud... (4 Replies)
Discussion started by: cdfd123
4 Replies

10. UNIX for Dummies Questions & Answers

using awk or sed to print output from one file

dear i have one file regarding >abshabja>sdksjbs>sknakna>snajxcls so i want to be output like >abshabja >sjkabjb >sknakna >snajxcls Any using awk or sed will help thanks (2 Replies)
Discussion started by: cdfd123
2 Replies
Login or Register to Ask a Question