merge multiple lines from flat file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting merge multiple lines from flat file
# 1  
Old 12-05-2006
merge multiple lines from flat file

Hi,

I have a tab delimited flat file like this:
Code:
189     Guide de lutilisateur sur lappel conférence à trois au moyen d'adaptateurs téléphoniques        <TABLE><TBODY><TR><TD><DIV class=subheader>La fonction Appel conférence à trois </DIV></TD>
\
<TD><?php print $navTree["features"]["3_way_calling"]["name"];?> vous permet de tenir un appel conférence simultanément avec deux autres parties. </TD></TR>
\
<TR>
\
<TD height=10></TD></TR>
\
<TR>
\

How do I merge all these lines into one single line? I searched through the forum, but did not find anything helpful.

TIA,
# 2  
Old 12-05-2006
what lines do you want to 'concatinate'?
ALL the lines?
Lines with a single '\' appearing on a traling line?
Something else?
# 3  
Old 12-05-2006
Hi vgersh,

Thanks for the reply. I was looking to join everything into one line, irrespective of whether there is a '\' or not.

TIA,
# 4  
Old 12-05-2006
Quote:
Originally Posted by hnhegde
Hi vgersh,

Thanks for the reply. I was looking to join everything into one line, irrespective of whether there is a '\' or not.

TIA,
Code:
tr -d '\n' < myFile

# 5  
Old 12-05-2006
Thanks a lot for the command vgersh!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge multiple lines into a single line

Hi all, I'm relatively new to scripting, I can do pretty basic things. I have a daily log file that looks like: timestamp=2017-06-28-01.01.35.080576; event status=0; userid=user1; authid=user1; application id=10.10.10.10.11111.12345678901; application name=GUI; ... (29 Replies)
Discussion started by: dwdnet
29 Replies

2. UNIX for Dummies Questions & Answers

Need help combining txt files w/ multiple lines into csv single cell - also need data merge

:confused:Hello -- i just joined the forums. I am a complete noob -- only about 1 week into learning how to program anything... and starting with linux. I am working in Linux terminal. I have a folder with a bunch of txt files. Each file has several lines of html code. I want to combine... (2 Replies)
Discussion started by: jetsetter
2 Replies

3. Shell Programming and Scripting

Merge multiple lines in one line

Hi guys, So i have a input file with several sequences aligned (fasta) >NC_005930 241 bp MNMINIFIINNIFDQFIPVKLSIFSLTSVGSIIA LSWVWINTKTHWAISRSNTP-SLLLNSL WTLLITNL-NEKTNPWAPWLFSLFLLCFSFNIMSLI-PYTF-SQ TSHLSFTFGLSLPIWIMVNIAGFKNNWKKKISHLLPQGTPIYLVPVMII IETISLFIQPLTLGFRLGANLLAGHLLIFLCSCTIWE... (6 Replies)
Discussion started by: andreia
6 Replies

4. Shell Programming and Scripting

Merge multiple lines in same file with common key using awk

I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic! ;) I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff... (6 Replies)
Discussion started by: protosd
6 Replies

5. Shell Programming and Scripting

Using Perl to Merge Multiple Lines in a File

I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated! My input file looks like (Unix): marker,allele1,allele2 RS1002244,1,1 RS1002244,1,3 RS1002244,3,3 RS1003719,2,2 RS1003719,2,4 RS1003719,4,4 Most markers are listed 3 times but a few... (2 Replies)
Discussion started by: Peggy White
2 Replies

6. Shell Programming and Scripting

Deleting lines in a flat file

Hi Friends I have a flat file which has sentence like "Notice generated". It can be anywhere in the flat file. What I want to do is, I want to delete all the lines which are above sentence "Notice generated". How can I do it. Kindly advice. Anushree (5 Replies)
Discussion started by: anushree.a
5 Replies

7. Shell Programming and Scripting

Merge lines in Flat file based on first 5 characters

Hi I have the fixed width flat file having the following data 12345aaaaaaaaaabbbbbbbbbb 12365sssssssssscccccccccc 12365sssss 12367ddddddddddvvvvvvvvvv 12367 vvvvv Here the first column is length 5 second is length 10 third is length 10 if the second or third column exceeds... (3 Replies)
Discussion started by: Brado
3 Replies

8. Shell Programming and Scripting

Removing end of line to merge multiple lines

I'm sure this will be an easy question for you experts out there, but I have been searching the forum and working on this for a couple hours now and can't get it right. I have a very messy data file that I am trying to tidy up - one of the issues is some records are split into multiple lines: ... (4 Replies)
Discussion started by: tink
4 Replies

9. Shell Programming and Scripting

How to read lines from a flat file

i have some commands written line by line in one flat file i have to read each linefrom this file(file name passed as parameter) and then i have to execute this How can i do it? (2 Replies)
Discussion started by: bihani4u
2 Replies

10. Shell Programming and Scripting

Use sed to merge multiple lines

Hi all: I have a file in which the contents are as following: ... This is a test ONE TWO Hello, world! XXX YYY CCC test again three, four five six seven world AAA BBB QQQ test eight, nine world (3 Replies)
Discussion started by: xb88
3 Replies
Login or Register to Ask a Question