Add line break for each line in a file

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Add line break for each line in a file
# 1  
Old 07-01-2011
Add line break for each line in a file

I cannot seem to get this to work..

I have a file which has about 100 lines, and there is no end of line (line break \n) at the end of each line, and this is causing problem when i paste them into an application.

the file looks like this

this is a test
that is a test

although they look normal, they don't have linebreaks at the end of each line.
# 2  
Old 07-01-2011
Run through cat -vte to see if there are blanks or carriage returns to make apparent new lines.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace and add line in file with line in another file based on matching string

Hi, I want to achieve something similar to what described in another post: The difference is I want to add the line if the pattern is not found. File 1: A123, valueA, valueB B234, valueA, valueB C345, valueA, valueB D456, valueA, valueB E567, valueA, valueB F678, valueA, valueB ... (11 Replies)
Discussion started by: jyu3
11 Replies

2. Shell Programming and Scripting

Line Break Issue in XML file

Hi Experts, Kindly help me to resole the line break issue mentioned below sample xml file: sample source File: ============== <?!New XML File><NEWRECORDS xmlns... (3 Replies)
Discussion started by: UnniVKN
3 Replies

3. UNIX for Dummies Questions & Answers

add a string to a file without line break

I searched and found "echo -n" and "printf" are solution for this, but they are not here: $ echo "hello" >> test $ cat test hello $ echo -n "world" >> test $ cat test hello world $ echo -n " seriously?" >> test $ cat test hello world seriously? This is not successful... (15 Replies)
Discussion started by: stunn3r
15 Replies

4. Shell Programming and Scripting

how do I break line in a file when a pattern is matched ?

Hi All, I am stuck for quite sometime now. Below is a line in my file - GS|ED|001075|001081|20110626|1806|100803|X|004010ST|130|100803001 This line occurs only once and it is the second line. I have to break this line into two lines from ST (bold) such that it looks like -... (5 Replies)
Discussion started by: ihussain
5 Replies

5. 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

6. Shell Programming and Scripting

How to remove line break character in a file

Hi, we are trying to process a csv file,in which we are getting data with line breaks.How to remove the line break character in the file? when i try to print the line break charcter using od -c,it gives as '\n' character for both line break and line feed. Please provide your valuable... (6 Replies)
Discussion started by: cnraja
6 Replies

7. Shell Programming and Scripting

How to remove line break in a csv file

Hi Experts, My requirement is to read the csv file and need to remove if any line break in it. sample data: Row1: "Oslo, Symra kino",Oslo,130-7,Symra 1,130-7-91 Row2:"Tønsberg, Brygga Kino SF",Tønsberg,202-1, Tønsberg SF 4,202-1-4 Expected data: Row1: "Oslo, Symra... (6 Replies)
Discussion started by: cnraja
6 Replies

8. Shell Programming and Scripting

How to filter only comments while reading a file including line break characters.

How do I filter only comments and still keep Line breaks at the end of the line!? This is one of the common tasks we all do,, How can we do this in a right way..!? I try to ignore empty lines and commented lines using following approach. # \040 --> SPACE character octal... (17 Replies)
Discussion started by: kchinnam
17 Replies

9. Shell Programming and Scripting

Replacing characters in file with line break

Hi, Apologies if this has been asked before, but I searched and was not able to find an answer. It's probably a simple question to answer for those of you with some experience, though... I have a relatively long string where tokens are separated by the colon (':') character. Let's say the... (10 Replies)
Discussion started by: johnemb
10 Replies

10. Shell Programming and Scripting

Trim whitespace and add line break

All, I'm a newbie at shell scripting and regular expressions and I just need to take a file that's arranged like the one below, remove all leading and trailing whitespace and add a line break after each word. I've been able to remove a few spaces using various awk, sed and Perl scripts, but... (7 Replies)
Discussion started by: moose1
7 Replies
Login or Register to Ask a Question