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
LEARN ABOUT OPENSOLARIS
scr_set
curs_scr_dump(3CURSES) Curses Library Functions curs_scr_dump(3CURSES)
NAME
curs_scr_dump, scr_dump, scr_restore, scr_init, scr_set - read or write a curses screen from or to a file
SYNOPSIS
cc [ flag ... ] file ... -lcurses [ library ... ]
#include <curses.h>
int scr_dump(char *filename);
int scr_restore(char *filename);
int scr_init(char *filename);
int scr_set(char *filename);
DESCRIPTION
With the scr_dump() routine, the current contents of the virtual screen are written to the file filename.
With the scr_restore() routine, the virtual screen is set to the contents of filename, which must have been written using scr_dump(). The
next call to doupdate() restores the screen to the way it looked in the dump file.
With the scr_init() routine, the contents of filename are read in and used to initialize the curses data structures about what the terminal
currently has on its screen. If the data is determined to be valid, curses bases its next update of the screen on this information rather
than clearing the screen and starting from scratch. scr_init() is used after initscr() or a system(3C) call to share the screen with
another process which has done a scr_dump() after its endwin() call. The data is declared invalid if the time-stamp of the tty is old or
the terminfo capabilities rmcup() and nrrmc() exist.
The scr_set() routine is a combination of scr_restore() and scr_init(). It tells the program that the information in filename is what is
currently on the screen, and also what the program wants on the screen. This can be thought of as a screen inheritance function.
To read (write) a window from (to) a file, use the getwin() and putwin() routines (see curs_util(3CURSES)).
RETURN VALUES
All routines return the integer ERR upon failure and OK upon success.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
curs_initscr(3CURSES), curs_refresh(3CURSES), curs_util(3CURSES), curses(3CURSES), system(3C), attributes(5)
NOTES
The header <curses.h> automatically includes the headers <stdio.h> and <unctrl.h>.
Note that scr_init(), scr_set(), and scr_restore() may be macros.
SunOS 5.11 31 Dec 1996 curs_scr_dump(3CURSES)