linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mário Gamito" <gamito@gmail.com>
To: Glynn Clements <glynn@gclements.plus.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Changes in file (huge problem)
Date: Sun, 24 Dec 2006 23:31:24 +0000	[thread overview]
Message-ID: <458F0DCC.3040009@gmail.com> (raw)
In-Reply-To: <17806.64985.640326.23994@cerise.gclements.plus.com>

Hi Glynn,

Thank you so much for your answer.

I've used your code in a script and run:
# cat passwords.sql | your_script

but all i get is a file named typescrypt with this content:
Script started on Sun Dec 24 23:24:28 2006

What am i doing wrong ?

Warm Regards,
Mário Gamito

Glynn Clements wrote:
> Mário Gamito wrote:
> 
>> I have this file in the following format:
>>
>> tarta 16340309 marsanpin brigittamario@xxx.pt
>> lms doom123 Luis Miguel Sequeira lms@xxx.pt
>> jura teste Juraci jgweb@bol.com.br
>> jsilva t00lt0ya5 Jorge Silva jsilva@xxx.com
>> tchock  mail#4829 tchock  engDias@xxx.pt
>> reporterx noname Duarte Oliveira mtbf99@xxx.com
>> erkulix brunoverab4 Bruno Cruz
>>
>> First field is a username;
>> Second field is a password in clear text;
>> *Last field is the email;
>> The field between is the name.
>>
>> As you can see, some lines don't have the name, and names have an unknow 
>> number of words.
>> Some lines don't have the e-mail.
>>
>> What i need is:
> 
>> Substitute spaces for ":", *except* of course the spaces within the name.
> 
> #!/usr/bin/sed -f
> s/^\([^ ]\+\) \+\([^ ]\+\) \+\(.\+\) \+\([^ @]\+@[^ @]\+\) *$/\1:\2:\3:\4/
> s/^\([^ ]\+\) \+\([^ ]\+\) \+\([^ @]\+@[^ @]\+\) *$/\1:\2::\3/
> s/^\([^ ]\+\) \+\([^ ]\+\) \+\(.\+\) *$/\1:\2:\3:/
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2006-12-24 23:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-24 13:51 Changes in file (huge problem) Mário Gamito
2006-12-24 22:23 ` Glynn Clements
2006-12-24 23:31   ` Mário Gamito [this message]
2006-12-26 23:48     ` Glynn Clements
2006-12-25 10:25 ` terry white
2006-12-25 19:09   ` Mário Gamito

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=458F0DCC.3040009@gmail.com \
    --to=gamito@gmail.com \
    --cc=glynn@gclements.plus.com \
    --cc=linux-admin@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).