Solved

zcat - clarification?

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

Title # Comments Views Activity
AWS - HAProxy- KeepAlived 5 51
linux SFTP 8 60
Intel fortran compiler (ifort) 5 38
CLI command keep running after close 7 36
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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

860 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