write to other file

Hi,

I have 2 files.

file1
abc123

file2

zxcqwe

when I write file2 to file1 like that; file2 >> file1
file 1 like that;

abc123zxcqwe

how can I copy to next line. file1 shoul be;

abc123
zxcqwe

thanks

Alice.

echo "\n" >> file1
cat file1>>file2

does not work. output file same as my example. it should be

abc123
zxcqwe

not

abc123zxcqwe

echo >> f1
cat f2 >> f1

Whatever created the original files did not create them in unix text file format. I can re-create your issue by creating the files on a M$ platform with Windows Notepad and then transferring the files to a unix platform using text file ftp.

try this,

echo -e "\n" >> file1;cat file2>>file1;cat file1 :slight_smile:

If you are looking *nixfile in Notepad then result is just what you told. Notepad need <cr><lf>, *nix files include only <lf>. Using ex. Wordpad, you can see the file as *nix files look in *nix.

od -c file1 file2
unix2dos f1 f2
cat f2 >> f1

and your file is $M/dos textfile.
ftp option ascii make conversion, option binary not.

# and convert dos textfile to *nix textfile
cat dosfile | tr -d '\014\ > nixfile
{ cat f2; echo; } >> f1