Format a file to another one

Hi All,

I have a file like the following. What I am trying to do is formatting the file to another format which is compatible to put that in a DB. The following file is the output of

unzip -l filename.zip
Archive:  AMT1-NA-20101007-1.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
    81788  10-07-10 07:30   00F06E96.TIF
     2475  10-07-10 07:30   AMT1-NA-20101007-1.ctl
 --------                   -------
    84263                   2 files

The formatted file should be like the following.

00F06E96.TIF  81788
AMT1-NA-20101007-1.ctl  2475

Can any one help me to develop a script for this? It would be a great help.

unzip -l AMT1-NA-20101007-1.zip | awk '/[0-9]:[0-9]/ {print $4,$1}'
1 Like

Excellent. I liked the logic... :wink: