Unix Shell - Re: Unix shell script for reformatting data

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > June 2006 > Re: Unix shell script for reformatting data





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Unix shell script for reformatting data
John W. Krahn

2006-06-08, 7:23 pm

yilmaz.celik@gmail.com wrote:
> Thanx a lot John, this works very well but i have one problem my format
> is like this
>
> check a
> _______
> [1]
> [2]
> [3]
> check b
> _______
> [4]
> [5]
> check c
> _______
>
> [6]
> [7]
> [8]
>
>
> because of the [] character yours does not work. sorry about not
> gicving the exact format before.


$ echo "
check a
_______
[1]
[2]
[3]
check b
_______
[4]
[5]
check c
_______

[6]
[7]
[8]

" | PERL -lne'$check = $_ if /^check/; print "$check $1" if /(\d+)/'
check a 1
check a 2
check a 3
check b 4
check b 5
check c 6
check c 7
check c 8



John
--
use Perl;
program
fulfillment
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com