From: "Nikolay A. Fetisov" <naf@naf.net.ru> To: smoke-room@lists.altlinux.org Subject: Re: [room] Помогите с регулярным выражением Date: Tue, 14 May 2013 18:48:20 +0400 Message-ID: <1368542900.20845.4.camel@v3405.naf.net.ru> (raw) In-Reply-To: <CABUeJrQB=ixXqtL0tO-PbgbtGbPE_Ew=6AYzGoiieH_UQcC4Gw@mail.gmail.com> В Вт, 14/05/2013 в 17:27 +0400, Aleksey Birukov пишет: > Есть такой вот текст: .... > > > > Как извлечь текст между "***"? Мне нужно поместить эти параграфы > каждый отдельно в массив или в базу. > > Хотелось бы использовать sed, awk, grep, cut и т.п. Достаточно одного awk: awk 'BEGIN{i=0} {if (/^\*\*\*$/) {i+=1;} else {print >> "p."i}}' file Куски файла file - в файлах p.N . -- С уважением, Николай Фетисов
parent reply other threads:[~2013-05-14 14:48 UTC|newest] Thread overview: expand[flat|nested] mbox.gz Atom feed [parent not found: <CABUeJrQB=ixXqtL0tO-PbgbtGbPE_Ew=6AYzGoiieH_UQcC4Gw@mail.gmail.com>]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1368542900.20845.4.camel@v3405.naf.net.ru \ --to=naf@naf.net.ru \ --cc=smoke-room@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Культурный офтопик This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/smoke-room/0 smoke-room/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 smoke-room smoke-room/ http://lore.altlinux.org/smoke-room \ smoke-room@lists.altlinux.org smoke-room@lists.altlinux.ru smoke-room@lists.altlinux.com smoke-room@altlinux.ru smoke-room@altlinux.org smoke-room@altlinux.com public-inbox-index smoke-room Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.smoke-room AGPL code for this site: git clone https://public-inbox.org/public-inbox.git