Back to Help Center

EXTRAÇÃO (EXTRACTION)

Equipe Learning

Extrair uma lista de tags em um arquivo de lista

  • Aqui estamos procurando as tags "4-PM-", "NUMMER" e "T4-TAMBOUR-NO" e copiamos as linhas que as contêm em um novo arquivo.
for f in *.csv; do
   if [ $(echo $f | grep -c pi_pm4) -gt 0 ]; then
      if  [ $(egrep -a -h "4-PM-|NUMMER|T4-TAMBOUR-NO" "$f" | wc -l) -gt 0 ]; then
         newf=break_pm4_"$f"
         egrep -a -h "4-PM-|NUMMER|T4-TAMBOUR-NO" "$f" > "$newf"
         mv "$newf" "$PathRepo"
      fi
   fi
done
Powered by Zendesk