Solved

zcat - clarification?

Posted on 2010-11-17
3
536 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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…
Fine Tune your automatic Updates for Ubuntu / Debian
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now