Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: data transformation

Re: data transformation

From: Arto Viitanen <arto.viitanen_at_csc.fi>
Date: Wed, 14 Feb 2007 09:02:42 +0200
Message-ID: <45d2b40c$0$1723$ba624cd0@newsread.funet.fi>


m.t wrote:
> I have log file with data like this:
>
> 20608694;20416953;20420430;20414156;20409061;20606877;20609113;20607051;20607052;20608204;
> 20418197;20408410;20606460;20606462;20607297;20607356;20415876;20426551;20419862;20421635;
>
> Is there a way (Windows or Unix) to transform it to single column ?
>

Since all answer were in Unix, I thought to give a Windows one: Use Microsoft's Powershell and give following command

gc log.txt | foreach { $_.split(';') } | where-object {$_ -ne ''} | foreach {$_+';'}

You can give the pipeline as a parameter to the powershell program, like

powershell -command "&{ gc log.txt | foreach { $_.split(';') } | where-object {$_ -ne ''} | foreach {$_+';'} }"

(both are one line)

-- 
Arto Viitanen, CSC Ltd.
Espoo, Finland
Received on Wed Feb 14 2007 - 01:02:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US