Hello All,
Could be I am in the wrong forum here so please bear with me.
I have a situation where a script is outputting two txt files.
Part of the script uses tr -d '\n' which I believe gets rid of all new line characters.This is neccessary so I will have to leave that in.
Later in the script, these two txt files are put together, and sent as an attachment using sendmail and uuencode.
Now to the problem.
Suppose the first txt file looks like this:
this is a txt file called bob
and the other one:
this is a txt file called billy
I do a cat file1 file2 > file3 and then a /usr/bin/unix2dos /path/to/file3 /path/to/file4 and then send of file 4 as an attachment.
I was hoping that the unix2dos utility would convert it to a format that windows can read.
On the receiving end (windows/dos) the file they receive looks like this:
this is a txt file called bobthis is a txt file called billy
which I don't want.
I am very new to unix, so I create a file called 'CR' which only contains an 'enter' character. Then I do
cat file1 CR file2 > file3 and then a /usr/bin/unix2dos /path/to/file3 /path/to/file4 and send this of.
Now the output looks like this:
this is a txt file called bob
this is a txt file called billy
which is much better. The only thing I can't figure out is how to get rid of that extra empty line between the two so the end result looks like this:
this is a txt file called bob
this is a txt file called billy
Has anybody got any ideas? And if you made this far, thank you for reading this newbie's long long question that probably has a simple simple solution.
Could be I am in the wrong forum here so please bear with me.
I have a situation where a script is outputting two txt files.
Part of the script uses tr -d '\n' which I believe gets rid of all new line characters.This is neccessary so I will have to leave that in.
Later in the script, these two txt files are put together, and sent as an attachment using sendmail and uuencode.
Now to the problem.
Suppose the first txt file looks like this:
this is a txt file called bob
and the other one:
this is a txt file called billy
I do a cat file1 file2 > file3 and then a /usr/bin/unix2dos /path/to/file3 /path/to/file4 and then send of file 4 as an attachment.
I was hoping that the unix2dos utility would convert it to a format that windows can read.
On the receiving end (windows/dos) the file they receive looks like this:
this is a txt file called bobthis is a txt file called billy
which I don't want.
I am very new to unix, so I create a file called 'CR' which only contains an 'enter' character. Then I do
cat file1 CR file2 > file3 and then a /usr/bin/unix2dos /path/to/file3 /path/to/file4 and send this of.
Now the output looks like this:
this is a txt file called bob
this is a txt file called billy
which is much better. The only thing I can't figure out is how to get rid of that extra empty line between the two so the end result looks like this:
this is a txt file called bob
this is a txt file called billy
Has anybody got any ideas? And if you made this far, thank you for reading this newbie's long long question that probably has a simple simple solution.