LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Concatenate Problem - First & Last file are Overlaying (https://www.linuxquestions.org/questions/linux-newbie-8/concatenate-problem-first-and-last-file-are-overlaying-708723/)

donanap 03-02-2009 09:32 PM

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.

David the H. 03-02-2009 10:22 PM

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}"

shakezilla 03-02-2009 10:27 PM

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.

donanap 03-03-2009 01:23 AM

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

David the H. 03-03-2009 10:54 AM

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.

shakezilla 03-04-2009 03:38 PM

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.


All times are GMT -5. The time now is 08:04 PM.