frase em uma linha usando awk

-1

Eu extraí os dados por comandos e salvei no arquivo kwrite, mas agora eu quero recuperar alguns dados importantes dele, mas os dados devem estar idealmente em uma linha, enquanto no meu caso eles se dividem em 2,3 linhas. começar com o Jpak é de interesse. Dados:

Jpak= its just a sample data for posting,
solve the query asap

Breadth=44


***** less*****
--
Effective search space used: 2418848120


Jpak= To work late into the night, alluding to the
 time before electric lighting

Breadth=75


***** less*****
--


Jpak= Speak of an issue, (mostly current) which ,
many people ,
are talking 

Breadth=22


***** less *****
- -

Saída desejada:

Jpak= its just a sample data for posting solve the query asap

Jpak= To work late into the night alluding to the time before electric lighting

Jpak= Speak of an issue (mostly current) which many people  are talking 
    
por Rhea 20.09.2017 / 09:39

2 respostas

0
perl -n00E '/Jpak=/ and s/\s+/ /g and say' ex.txt
  • -n00E - para cada parágrafo separado de linha vazia, faça ...
  • /Jpak=/ and - encontre o padrão desejado e ...
  • s/\s+/ /g - substitui sequências de espaços, novas linhas e tabulações por um único espaço
  • and say - e diga o que foi encontrado.

A saída é:

Jpak= its just a sample data for posting, solve the query asap 
Jpak= To work late into the night, alluding to the time before electric lighting 
Jpak= Speak of an issue, (mostly current) which , many people , are talking 
    
por JJoao 20.09.2017 / 16:17