Solved

zcat - clarification?

Posted on 2010-11-17
3
532 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
Comment Utility
zcat file.gz | sed 1d | cut ......
0
 

Author Comment

by:PKTG
Comment Utility
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
Comment Utility
Are you using cygwin or something else?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sed question 2 45
Image not there 4 32
Missing Apache mod_DBD packages in Centos 7 2 33
move command 5 29
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

763 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

9 Experts available now in Live!

Get 1:1 Help Now