Visit Our UNIX and Linux User Community

Concate all lines into one.

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Concate all lines into one.
# 1  
Old 10-03-2002
Data Concate all lines into one.

I have a file with 1000 records and I have to produce another file with 1 line which is a concatentation of all these records.
Please help.
# 2  
Old 10-03-2002
Try these two commands:

tr -d "\n" < input > output
echo >> output

Previous Thread | Next Thread
Test Your Knowledge in Computers #1010
Difficulty: Easy
The number 200 in base 8 equals 128 in base 10.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merging multiple lines to columns with awk, while inserting commas for missing lines

Hello all, I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person. In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies

2. Shell Programming and Scripting

ksh sed - Extract specific lines with mulitple occurance of interesting lines

Data file example I look for primary and * to isolate the interesting slot number. slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'` Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Discussion started by: popeye
2 Replies

3. Shell Programming and Scripting

Concate a string in awk

Hello Community, i have a litte Problem with concating a string in an awk command. val_arr=( $( cat myfile | awk ' NR==1 { name=$2} NR==3 { dateformat=$9 OFS $6 OFS $8 OFS $7 OFS $10} NR==4 { length=$8} NR==5 { progress=int($3) } END{print name,dateformat,length,progress}; ... (6 Replies)
Discussion started by: demonking
6 Replies

4. Shell Programming and Scripting

Perl XML, find matching condition and grep lines and put the lines somewhere else

Hi, my xml files looks something like this <Instance Name="New York"> <Description></Description> <Instance Name="A"> <Description></Description> <PropertyValue Key="false" Name="Building A" /> </Instance> <Instance Name="B"> ... (4 Replies)
Discussion started by: tententen
4 Replies

5. Shell Programming and Scripting

String concate problem

Hello there, I am facing the following problem in string concate. I am returning a sql column value to a shell script variable . Now when I am trying to concate the variable with another string (string appears first) I am getting a space between the two concate. Example p is the shell... (2 Replies)
Discussion started by: Pratik4891
2 Replies

6. Shell Programming and Scripting

Concate 2 line into 1 line

Hi, 000732140470,DD,R,29.99 ,SOM=1 000732145376,DD,R,29.99 ,MOM=0,SOM=0 000732155320,DD,R,29.99 ,MOM=0 000732156860,DD,D,9.99 ,MOM=3,RNO=3,SOM=1 000732156921,DD,D,9.99 ,MOM=5,RNO=5,SOM=7 000732157461,DD,R,29.99 ,SOM=0 (6 Replies)
Discussion started by: vaskarbasak
6 Replies

7. Solaris

concate / stripes in solaris 8 to solaris 10

We did live upgrade from solaris 8 (primary boot environment) to 10 . Switching to alternative boot environment in solaris 10 succeeded but it gave disk error for our concat , strips & mirrors for existing mount points which are already in use . It advised to run fsck on these device. So I... (6 Replies)
Discussion started by: Hitesh Shah
6 Replies

8. UNIX for Dummies Questions & Answers

using nawk to concate the fields

I have the the following question: # cat report.lis | nawk -F: '{ if($0 ~ "^BE NO:") print "report_"$2".lis"}' :confused: .lisrt_ 111 .lisrt_ 111 .lisrt_ 222 .lisrt_ 222 .lisrt_ 333 .lisrt_ 333 # cat report.lis | nawk -F: '{ if($0 ~ "^BE NO:") print "report_" $2}' report_ 111 report_... (2 Replies)
Discussion started by: raychu65
2 Replies

9. Shell Programming and Scripting

concate the record

how i can bring this file into three records in my sample text file there are thre records new records always start with Data File ================================================== samle file ================================================= Data File:... (7 Replies)
Discussion started by: aboorkuma
7 Replies

10. UNIX for Dummies Questions & Answers

How to count lines - ignoring blank lines and commented lines

What is the command to count lines in a files, but ignore blank lines and commented lines? I have a file with 4 sections in it, and I want each section to be counted, not including the blank lines and comments... and then totalled at the end. Here is an example of what I would like my... (6 Replies)
Discussion started by: kthatch
6 Replies

Featured Tech Videos