Need help with AWK 
Author Message
 Need help with AWK

Hello All,

I have following input in one file.

aratyslc1 aratyslc1.1 /ix/araty1.1 1572864
aratyslc1 aratyslc1.10 /ix/araty4.4 1572864
aratyslc1 aratyslc1.11 /ix/araty4.5 1572864
aratyslc1 aratyslc1.12 /ix/araty4.6 1572864
aratyslc1 aratyslc1.13 /ix/araty2.1 1572864
aratyslc1 aratyslc1.14 /ix/araty2.2 1572864
aratyslc1 aratyslc1.15 /ix/araty2.3 1572864
aratyslc1 aratyslc1.16 /ix/araty2.4 1572864
aratyslc1 aratyslc1.17 /ix/araty2.5 1572864
aratyslc1 aratyslc1.18 /ix/araty2.6 1572864
aratyslc1 aratyslc1.2 /ix/araty1.2 1572864
aratyslc1 aratyslc1.3 /ix/araty1.3 1572864
aratyslc1 aratyslc1.4 /ix/araty1.4 1572864
aratyslc1 aratyslc1.5 /ix/araty1.5 1572864
aratyslc1 aratyslc1.6 /ix/araty1.6 1572864
aratyslc1 aratyslc1.7 /ix/araty4.1 1572864
aratyslc1 aratyslc1.8 /ix/araty4.2 1572864
aratyslc1 aratyslc1.9 /ix/araty4.3 1572864

How can i display output like this

create dbslice aratyslc1 from
                   cogroup cogroup_all chunk "/ix/araty1.1" size 1572864
kbytes,
                   cogroup cogroup_all chunk "/ix/araty4.4" size 1572864
kbytes,
                    cogroup cogroup_all chunk" /ix/araty4.5" size
1572864 kbutes,
and so on for all $3 and $4

I will apprteciate for any help.

Thanks

Sanjeev K. Sagar



Sun, 28 Oct 2001 03:00:00 GMT  
 Need help with AWK

% I have following input in one file.
%
% aratyslc1 aratyslc1.1 /ix/araty1.1 1572864
% aratyslc1 aratyslc1.10 /ix/araty4.4 1572864
% aratyslc1 aratyslc1.11 /ix/araty4.5 1572864

[...]

% How can i display output like this
%
% create dbslice aratyslc1 from
%                    cogroup cogroup_all chunk "/ix/araty1.1" size 1572864
% kbytes,
%                    cogroup cogroup_all chunk "/ix/araty4.4" size 1572864
% kbytes,
%                     cogroup cogroup_all chunk" /ix/araty4.5" size
% 1572864 kbutes,
% and so on for all $3 and $4

You save $1 so you know when to kick out a new `create' line, then you
spit out $3 and $4 with some text around them for each input line:

 $1 != old1 { old1 = $1; print "create dbslice " $1 " from" }
 { print "                   cogroup cogroup_all chunk \"" $3 "\" size " $4 }
--

Patrick TJ McPhee
East York  Canada



Mon, 29 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. need help using AWK

2. Need help with awk script

3. need help on awk script

4. Need Help on awk!!!! **** Urgent ****

5. Need help with awk

6. Need help on awk?

7. I need help with AWK Script?! any 1?

8. Need help with sed or awk !!

9. Need a bit of awk help, very new to it

10. newbie needs help with multiple expressions in awk

11. Need some help with awk addition

12. Need awk (or sed) help PLEASE!

 

 
Powered by phpBB® Forum Software