Search Results

Search: Posts Made By: acoding
2,671
Posted By Scrutinizer
Yet another one: awk '/movie names/{$1=x;...
Yet another one:
awk '/movie names/{$1=x; sub(FS,x); print}' FS='\n' OFS='\n' RS= file

or

awk '/movie names/{print substr($0,index($0,FS)+1)}' FS='\n' RS= file

or

awk '/movie...
2,671
Posted By Chubler_XL
Her is another awk approach: awk '/^movie...
Her is another awk approach:

awk '/^movie name/ {
gsub("[^\n]+: *",x)
l=split($0,a,ORS)
for(i=1;i<=l;i++) if(a[i]) print a[i]
}' RS='' infile
2,671
Posted By vgersh99
you have inconsistent format of the 'movie names'...
you have inconsistent format of the 'movie names' and "move name". Here's how to accommodate both. (Somehow gawk's RS='' doesn't work as described in 'man gawk' - makes the code a bit hairy):

...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 02:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy