Solved

zcat - clarification?

Posted on 2010-11-17
3
539 Views
Last Modified: 2012-08-14
I have 5 zipped files (.gz ) with header. All files header is same. I want to create new single file with limited columns from these 5 files without Header. I thought of using below command but I don’t know how to skip header from each file Please let me know how to do this task and below command is fine or i need to change anything.
zcat C:\filename1.gz| Cut -f 4,11-13,15,17-20 >> e:\test.txt
zcat C:\filename2.gz| Cut -f 4,11-13,15,17-20 >> e:\test.txt
zcat C:\filename3.gz| Cut -f 4,11-13,15,17-20 >> e:\test.txt
zcat C:\filename4.gz| Cut -f 4,11-13,15,17-20 >> e:\test.txt
zcat C:\filename5.gz| Cut -f 4,11-13,15,17-20 >> e:\test.txt
0
Comment
Question by:PKTG
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
ID: 34160457
zcat file.gz | sed 1d | cut ......
0
 

Author Comment

by:PKTG
ID: 34160536
I tried the below command and got the error. Please advise

zcat C:\filename1.gz | sed 1d | Cut -d "," -f 4,11-13,15,17-20 >> e:\test.txt

Error:
Cut: the delimiter must be a single character
Try `Cut --help' for more information.
sed: couldn't write 1212 items to {standard output}: Invalid argument
zcat: stdout: Broken pipe

0
 
LVL 48

Expert Comment

by:Tintin
ID: 34161689
Are you using cygwin or something else?
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question