What happend?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What happend?
# 1  
Old 05-08-2008
What happend?

Hi everybody:

Could anybody tell me how I can solve this mistake.
I have two files and i would like one, so I use the cat command, like always:

Code:
cat file1.dat file2.dat > file3.dat

But the first line from file2.dat is concatenated with the last line from file1.dat:

HTML Code:
file1.dat
9.847 288.62 236.214 0.0240591
11.182 237.134 228.403 0.00668509
12.78 185.821 218.073 0.00442575
14.72 135.954 206.446 0.000999376
17.04 92.7462 207.773 0.000292767
19.82 58.9373 213.877 0.000150917
23.15 34.7545 218.214 0.000264972

file2.dat
27.12 20.24 228.2 0.0005150
31.85 10.17 238.1 0.0002323
37.47 4.681 251.4 0.00006923
44.12 1.968 267.9 0.00002193
51.99 0.7303 270.2 0.000001041
61.27 0.2134 243.3 0.0000003702
72.19 0.04522 217.4 0.00000009763
85.00 0.004 214.0 0.00000001183
100.0 0.0003 210.0 0.000000001

file3.dat
9.847 288.62 236.214 0.0240591
11.182 237.134 228.403 0.00668509
12.78 185.821 218.073 0.00442575
14.72 135.954 206.446 0.000999376
17.04 92.7462 207.773 0.000292767
19.82 58.9373 213.877 0.000150917
23.15 34.7545 218.214 0.00026497227.12 20.24 228.2 0.0005150
31.85 10.17 238.1 0.0002323
37.47 4.681 251.4 0.00006923
44.12 1.968 267.9 0.00002193
51.99 0.7303 270.2 0.000001041
61.27 0.2134 243.3 0.0000003702
72.19 0.04522 217.4 0.00000009763
85.00 0.004 214.0 0.00000001183
100.0 0.0003 210.0 0.000000001
thanks in advance.
Cheers
Smilie
tonet
# 2  
Old 05-08-2008
Hi,

Problem may be because of some non-printable characters.

Can you the check the output of following commands

cat -v file1.dat

cat -v file2.dat



Thanks
Penchal
# 3  
Old 05-08-2008
It's because file1.dat lacks a terminating character at the end of the file.

Try to manually add a newline and retry Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Where does the 8 come from? (or what happend to the first `)

$ ksh $ echo "\047"0"\047" result: 8' (6 Replies)
Discussion started by: R.T.
6 Replies

2. Shell Programming and Scripting

its happend after restart.

From Sept 12th onwards i am facing some problem in the file permission. Normally the file get generated by a script with the permission 666 and from sept 12th onwards it get changed to 644 If we create a blank file using touch command it is with the permission 666, but the files which are... (3 Replies)
Discussion started by: onlytorobin
3 Replies
Login or Register to Ask a Question