У меня есть данные
15:29:05:493582: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:450] Ask[price:3215 qty:600].
15:29:05:480193: Impact Cost :Current[0.15] Required[5.00] Bid[price:3195 qty:450] Ask[price:3210 qty:75].
15:29:05:462943: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:450] Ask[price:3215 qty:600].
15:29:05:462886: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:450] Ask[price:3215 qty:600].
15:29:05:462789: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:450] Ask[price:3215 qty:600].
15:29:05:447389: Impact Cost :Current[0.15] Required[5.00] Bid[price:3195 qty:450] Ask[price:3210 qty:75].
15:29:05:446545: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:450] Ask[price:3215 qty:600].
15:29:05:446381: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:525] Ask[price:3215 qty:600].
15:29:05:409039: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:75] Ask[price:3215 qty:600].
15:29:05:409019: Impact Cost :Current[0.20] Required[5.00] Bid[price:3195 qty:75] Ask[price:3215 qty:600].
, которые я хочу вывести как
Bid[price:3195 qty:450] Ask[price:3215 qty:600].
Bid[price:3195 qty:450] Ask[price:3210 qty:75].
Bid[price:3195 qty:450] Ask[price:3215 qty:600].
Bid[price:3195 qty:450] Ask[price:3215 qty:600].
Bid[price:3195 qty:450] Ask[price:3215 qty:600].
Bid[price:3195 qty:450] Ask[price:3210 qty:75].
Bid[price:3195 qty:450] Ask[price:3215 qty:600].
Bid[price:3195 qty:525] Ask[price:3215 qty:600].
Bid[price:3195 qty:75] Ask[price:3215 qty:600].
Bid[price:3195 qty:75] Ask[price:3215 qty:600].
, скажите мне, как чтобы извлечь его из файла .txt с помощью терминала.
Это может быть очень просто. Если вы хотите, чтобы все элементы начинались со слова «Ставка» до конца строки, вы можете использовать просто:
grep -o 'Ставка. *' Yourfile.txt
Решение, не требующее обработчика регулярных выражений:
$ cut -d ' ' -f 6- logfile
Утилита cut
в этом случае предоставит вам все столбцы, начиная с шестого столбца. Он будет рассматривать каждый пробел в каждой строке как разделитель столбцов.