Solved

zcat - clarification?

Posted on 2010-11-17
3
542 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

733 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