LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-02-2009, 09:32 PM   #1
donanap
Member
 
Registered: Sep 2008
Location: Perth, Australia
Distribution: RedHat, Solaris
Posts: 38

Rep: Reputation: 15
Question Concatenate Problem - First & Last file are Overlaying


Hi,

I did search the forums, but could not find my problem listed. I hope its an easy solution and I apologise if it is! Im learning...

So, I am trying to concatenate some .pds files which are like .post script files and contain a lot of graphics & text. This is the command im using -

Code:
cat file1 file2 file3 file4 file5 file6 > file7
However when I open the file7 and let it spool the output that I am getting is

File1&File6 (on top of each other) then the rest of the files have concatenated correctly. So its like it has wrapped the last file6 and it is overlaying at the top of the file.

Is there a limit on how long/how much you can concatenate? or is there another useful variable I can use in this command to ensure that file6 stays at the bottom of the output file??

Would really appreciate anybodys help. Let me know if you need more information!
P.S - using RHEL 4.5.
 
Old 03-02-2009, 10:22 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I don't know exactly, but since postscript-type files are rather complex it might be something about the way the files are formatted that's causing problems. How about trying to concatenate them one-by-one and see if the problem is with a specific file?

FYI, you can shorten your command for a series of sequential files with "cat file[1-6]" or "cat file{1..6}"
 
Old 03-02-2009, 10:27 PM   #3
shakezilla
Member
 
Registered: Jun 2005
Location: U.S.
Distribution: xubuntu 8.10, linux 2.6.27-11-generic
Posts: 78

Rep: Reputation: 16
cat works on text files, not binary, which would include pdfs.

pdfsam is a good tool to use, although you will need a jvm to run it.

This page also has some info on doing it with imagemagick, which comes with most distros by default.
 
Old 03-03-2009, 01:23 AM   #4
donanap
Member
 
Registered: Sep 2008
Location: Perth, Australia
Distribution: RedHat, Solaris
Posts: 38

Original Poster
Rep: Reputation: 15
Question PDS - Not PDF

Hi,
Thanks for your suggestions. Shakezilla, I dont think this app will work for what I need. the documents I am trying to concat are PDS not PDF and work quite differently from each other, as far as my knowledge goes.

David The H. - Thanks for you suggestion to concat each file one at a time. I had already tried this previously and it does appear to be File 6 that has the problem, everything else concats fine. I tried concatting file 5 & 6 together and I get the same misfortunate result where file 6 is on top of file 5.
I have also tried to use different versions of this file (incase one was corrupt).

Im out of ideas - any more help would be appreciated! Thanks so far!!

Donanap
 
Old 03-03-2009, 10:54 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
It sounds to me then that the problem is entirely in file6 itself. I'm sure it's concatenating properly, but I'm guessing some bug or error in the way it's encoded causes it to always display as if it were the first page. So it's probably that file you have to correct, rather than the way you combine it with others.
 
Old 03-04-2009, 03:38 PM   #6
shakezilla
Member
 
Registered: Jun 2005
Location: U.S.
Distribution: xubuntu 8.10, linux 2.6.27-11-generic
Posts: 78

Rep: Reputation: 16
Doh

Yeah, I see that now. I guess I saw ".pds" in conjuction with ".post script" and it made me think of pdf and ps.
 
  


Reply

Tags
concatenate, linux



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
Flash player overlaying websites Ubumby Linux - Newbie 2 05-12-2007 06:19 PM
overlaying text to a video image mrobertson Programming 3 07-21-2005 12:11 PM
Concatenate binary file iftiuk Linux - General 6 05-16-2005 08:11 AM
PL/PGSQL - String concatenate problem jaunine Linux - Software 7 03-18-2005 07:11 AM
K3B Problem & File Size David@330 Linux - Newbie 0 08-30-2004 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 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
Open Source Consulting | Domain Registration