LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2011, 05:32 AM   #1
BarataPT
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Rep: Reputation: 1
Add newline EOF (.gz files)


Hi,

I have 165 files with .txt.gz type that store queries made on a browser. The problem is that the last query is always wrongly saved (because of lost connection).

What i want to do is when i'm writing the results to the STDOUT, add a newline at the end of each file, so that i can minimize this problem.

I read the files this way:
Quote:
find . -type f | xargs zcat
Then i use some perl script to do some calculations.

The large amount of data stored makes decompressing the .gz files impracticable.
 
Old 03-10-2011, 09:56 PM   #2
timetraveler
Member
 
Registered: Apr 2010
Posts: 243
Blog Entries: 2

Rep: Reputation: 31
Maybe if you provide more info someone can help.
 
Old 03-11-2011, 11:58 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,013

Rep: Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225
How about
Code:
find . -type f -exec zcat {} \; -printf '\n'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apt-get dpkg error: files list file ... missing final newline PBSchmidt Debian 11 02-10-2016 12:52 AM
cat 2 files without newline lea Programming 5 12-23-2010 04:54 PM
question about text/source files: what is the EOF indicator? rahul8705 Linux - General 2 11-10-2010 12:36 PM
Concatenating two files without creating a newline between them? linux_newestbie Linux - General 8 03-12-2010 09:16 AM
VI replacement: newline for newline not working! jhwilliams Linux - Software 3 08-16-2007 07:11 PM


All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration