Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2006 22:23:06 +0400
From:      "Oleg D." <perl@ipchains.ru>
To:        SigmaX asdf <fydernix@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: sed and comma-delimited file
Message-ID:  <4510358A.9040009@ipchains.ru>
In-Reply-To: <c04d7e300609190926t1e5dce14wea7ef1a16ccf9af1@mail.gmail.com>
References:  <c04d7e300609190926t1e5dce14wea7ef1a16ccf9af1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a cryptographically signed message in MIME format.

--------------ms020400050105040009050204
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit

SigmaX asdf wrote:
> Yo;
> 
> I have a series of comma-delimited text files with fourteen columns of
> data and several hundred rows.  I want to use a short shell script to
> strip them of the last 9 columns, leaving the same file but with just
> five of its columns.  I can do it in C++, but that seems like
> overkill.  How would I go about doing it with sed or a similar
> utility?
> 
> SigmaX

All of advices were cool
but!
there's a good idea to work around something like that, but I don't 
exactly know now how to solve your problem, the idea is:
`perl -pi~ -e 's/foo/bar/g' somefile`
works fine for `somefile'... I think TIMTOWTDI.


--
Oleg D.

-- 
don't believe every word people use to say, they might be wrong.

an undefined problem has infinitive number of solutions.

--------------ms020400050105040009050204
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIII/zCC
AtowggJDoAMCAQICEHZ8L/U1RkMGbaQ1o3z0oGcwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UE
BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMT
I1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDT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kqhkiG9w0BCQQxFgQUmZG5Q4YK0pZR98k7TNpEHy5W
1MswUgYJKoZIhvcNAQkPMUUwQzAKBggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZI
hvcNAwICAUAwBwYFKw4DAgcwDQYIKoZIhvcNAwICASgwgYUGCSsGAQQBgjcQBDF4MHYwYjEL
MAkGA1UEBhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAq
BgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBAhB2fC/1NUZDBm2k
NaN89KBnMIGHBgsqhkiG9w0BCRACCzF4oHYwYjELMAkGA1UEBhMCWkExJTAjBgNVBAoTHFRo
YXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQZXJzb25hbCBG
cmVlbWFpbCBJc3N1aW5nIENBAhB2fC/1NUZDBm2kNaN89KBnMA0GCSqGSIb3DQEBAQUABIIB
AJdO5h50HvJ9sSB0CIbIPd+2Kex8yXAG+GArXkEheTOnba4twTuzYIq0OT1Zk5KhkK8L/8bR
Of7ObfsGiyAPkTQVMbFj00S1fxGGb/d6aAaSTO6I/7hQT5/UNJ2AgoG1fuDNPRPVf4yYcllx
/lwitvEI0DV/29kSu+HLwWUw31zrYVkv0qp4nJfF7xu2GrrOyabnTWHc9KFSw7lhLD/AeAgL
wvmpKMN+DaMaTwur5Qukyrk29baBnKWROZU4gH2UynqyvBZMvcVYZ6IO81THChB0hPJZDZ4t
GsRe0k5M2jwidHHSpLNy/gRbGs14sEKJUo6fqAM+0KtEDCK4/Tk/2kYAAAAAAAA=
--------------ms020400050105040009050204--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4510358A.9040009>