[Solved] New Line in file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] New Line in file
# 1  
Old 01-17-2013
[Solved] New Line in file

Hi,

Though I was successful in following query, I like to know the other ways of doing it.

I have a file that is sent as an attachment via mail. However, while opening it, notepad does not recognize new line character whereas other editors like text pad recognizes new line character of unix.

abc.txt in Unix
Quote:
mno
pqr
stu
vwx
When I send it as file attachment from unix server, I dont see new line.
Code:
$ uuencode abc.txt abc.txt | mailx -s "Test" xyz@def.com

and the following is the content when I open the attachment

Quote:
mno<square symbol>pqr<square symbol>stu<square symbol>vwx<square symbol>
So I edited abc.txt and added "^M" by <CTL+V and CTL+M> at the end of each line. That resolved it. But I like to know, is there any other way to do it.
# 2  
Old 01-17-2013
Why dont you pass your text file through ux2dos / unix2dos utility before?
This User Gave Thanks to vbe For This Post:
# 3  
Old 01-17-2013
Did not knew about unix2dos before.
Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Replacing line of text while file is closed

Is it possible to replace a line of text within a file while it's closed with a single command or a script? Please show me an example or point me to a webpage that shows an example. The file has this line of text: LoginGraceTime 100 I want to replace it with the following: ... (2 Replies)
Discussion started by: wdg74
2 Replies

2. Shell Programming and Scripting

[Solved] How to separate one line to mutiple line based on certain number of characters?

hi Gurus, I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example: abcdefghi high abaddffdd I want to separate the line to multiple lines for every 4 charactors. the result should be abcd efgh i hi gh a badd ffdd Thanks in... (5 Replies)
Discussion started by: ken6503
5 Replies

3. Shell Programming and Scripting

[Solved] Not able to read the next line from a file after doing ssh

Hi, I am trying to write a code, where it reads the jobnames from a file and checks for the logs in the server. If the log is not found in the first server, then it will ssh to the 2nd server and get the details from there. I will need to save the date in a variable. But the problem is that,... (0 Replies)
Discussion started by: ajayakunuri
0 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Help to remove a line from a file

Hi, I just upgraded one my server to latest version RHEL, I have many users who will do SSH from another server. I wanted to update all of the users home directory and remove the security key. For example. /home/XYZ/.ssh/known_hosts and remove this hostsname. Please see below and advise.... (2 Replies)
Discussion started by: samnyc
2 Replies

5. Shell Programming and Scripting

[SOLVED] Sorting file and get everything on same line on condition

Good afternoon! I am a perl newbie. I hope you will be patient with me. I have a script that needs to be written in perl. I can't do it in awk or shell scripting. Here is the script: #!/usr/bin/perl use POSIX qw(strftime); use FileHandle; use Getopt::Long; use IO::Handle;... (0 Replies)
Discussion started by: brianjb
0 Replies

6. Shell Programming and Scripting

[Solved] making each word of a line to a separate line

Hi, I have a line which has n number of words with separated by space. I wanted to make each word as a separate line. for example, i have a file that has line like i am a good boy i want the output like, i am a good (8 Replies)
Discussion started by: rbalaj16
8 Replies

7. Shell Programming and Scripting

[Solved] Line Break Issue for an XML file

I got an XML file(file name TABLE.xml) which the data format has line breaks(with no Spaces, no Nulls, no characters between each line), I need to write a KSH script which gives me the data in single line as format shown below My input file which have line breaks: <TABLE> <TABLE-ROW> <S_NO>... (7 Replies)
Discussion started by: pred55
7 Replies

8. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

9. Shell Programming and Scripting

[Solved] Read a .gz file line by line without using gzcat

Hi all Is there a way to read and process a gzip file line by line similar to a text file without using gzcat.. while processing a text file we will usually use the logic exec<sample.txt while read line do echo $line done Is there a similar way to process the gz file in the same... (4 Replies)
Discussion started by: aikhaman
4 Replies

10. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
Login or Register to Ask a Question