04-02-2001
here is one trick:
tr "\n" " " < filename #displays on screen
tr "\n" " " < filename >output #redirect to a file
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how to use "tr" command to display horizontal line to vertical line
for vertical to horizontal, the command is tr '\n' '\t' <inputfile
but what is the command for horizontal to vertical
Thanks
Vasikaran (3 Replies)
Discussion started by: vasikaran
3 Replies
2. Programming
We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies
3. Programming
Hi power user,
I have this type of data (distance list):
file1
A B 10
B C 20
C D 50I want output like this
# A B C D
A 0 10 30 80
B 10 0 20 70
C 30 20 0 50
D 80 70 50 0 Which is a distance matrix
I have tried... (0 Replies)
Discussion started by: anjas
0 Replies
4. Shell Programming and Scripting
Korn Shell in AIX 6.1
I want to print the below shown pipe (|) separated list line by line.
line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883
for i in line
do
echo "Hello $line "
done
I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies
5. Shell Programming and Scripting
Hello,
I am trying to convert a line into a list using awk or sed.
Line:
345 897 567 098 123
output:
345
897
567
098
123
thanks (7 Replies)
Discussion started by: smarones
7 Replies
6. Shell Programming and Scripting
Hi All,
Random question, how would you convert a data file from a list like so:
12345
12346
12347
12348
12349
12350
... <snip 100+ lines> ...
to comma separated X columns across:
12345,12346,12347
12348,12349,12350
Why would you want to do this? The background to this is a... (2 Replies)
Discussion started by: craigp84
2 Replies
7. Shell Programming and Scripting
Hello,
I have a large database with the following structure:
set of clustered names followed by a hard return and followed by a second set of clustered names and so on. Sometimes the clusters can be as many as 150.
Since the data is in an Indian language, a theoretical example will make this... (9 Replies)
Discussion started by: gimley
9 Replies
8. Shell Programming and Scripting
Hello.
I have a long list of data which has the following structure
The number shows the unique identity of the word. And all homophones are clustered with the same number ID.
An example will make this clear
The awk script I have allows conversion of a list to row but on condition that each... (4 Replies)
Discussion started by: gimley
4 Replies
9. Shell Programming and Scripting
Hi there,
How can i shorten this:
grep -ri "Password must meet complexity requirements" "$line" | sed 's/\t/<\/td><td>/' | sed 's/^.*:/<tr><td>/'| sed 's/$/<\/td><\/tr>/'
I am looking for a shorter alternative of sed. What I was trying to do is to change the string output format from
... (3 Replies)
Discussion started by: alvinoo
3 Replies
10. UNIX for Advanced & Expert Users
Hi All,
Am needing advise on how to convert xls file to xlsx format on Solaris unix command line or scripting. I tried searching online but it looks like I need to either use Perl packages of Excel or Python packages or some other 3rd party tool. Problem is to install any of these will require... (2 Replies)
Discussion started by: arvindshukla81
2 Replies