ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Dmytro O. Redchuk" <dor@ldc.net>
To: community@altlinux.ru
Subject: Re: [Comm] Задачка
Date: Tue, 12 Jul 2005 11:01:55 +0300
Message-ID: <20050712080155.GC5353@ldc.net> (raw)
In-Reply-To: <20050712114332.4150060e.pvs@vdnet.ru>

On Tue, Jul 12, 2005 at 11:43:32AM +0400, Pavel Shurubura wrote:
> Здравствуйте !
> 
> Есть текстовый файл с разделителями '|' (pipe).
> В поле номер 5 есть дата такого формата:
> Thu, 07 Jul 2005 14:12:01 +0400
> т.е.
> 
> 123|Text|234|aaa|Thu, 07 Jul 2005 14:12:01 +0400|dsfas|asdkfj
> 
> Как-бы мне её преобразовать в число секунд since epoch ?
> 
> командочка date +'%s' 'Thu, 07 Jul 2005 14:12:01 +0400'
> Выдаёт мне то,что надо. Как вставить её вывод обратно в файл ?
> 
> на awk пытался передать параметр функции system таким образом:
> {
>   system("date +%s $5");
> }
> Но так не получается. Может подскажет кто чего ?
Если awk, то функция mktime. Хоть и горемойно, т.к. ей надо ещё скормить
дату в нужном ей виде.

Но awk'ом это всё можно -- "задача имеет решение" Ж-)

ps. Всё равно нужно как-то манипулировать пятым полем, так как там, как
    минимум, "лишняя" запятая.

> 
> Спасибо.
> 
> -- 
> With kindest regards, pvs.

-- 
  _,-=._              /|_/|
  `-.}   `=._,.-=-._.,  @ @._,
     `._ _,-.   )      _,.-'
        `    G.m-"^m`m'        Dmytro O. Redchuk



  parent reply	other threads:[~2005-07-12  8:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-12  7:43 Pavel Shurubura
2005-07-12  7:59 ` Pavel Shurubura
2005-07-12  8:01 ` Dmytro O. Redchuk [this message]
2005-07-12  8:23   ` Pavel Shurubura
2005-07-15 18:46 ` Aleksander Fetininsky

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=20050712080155.GC5353@ldc.net \
    --to=dor@ldc.net \
    --cc=community@altlinux.ru \
    /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

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git