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_restore
scr_dump(3XCURSES) X/Open Curses Library Functions scr_dump(3XCURSES)
NAME
scr_dump, scr_init, scr_restore, scr_set - write screen contents to/from a file
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int scr_dump(const char *filename);
int scr_init(const char *filename);
int scr_restore(const char *filename);
int scr_set(const char *filename);
PARAMETERS
filename Is a pointer to the file in which screen contents are written.
DESCRIPTION
These function perform input/output functions on a screen basis.
The scr_dump() function writes the contents of the virtual screen, curscr, to filename.
The scr_restore() function reads the contents of filename from curscr (which must have been written with scr_dump()). The next refresh
operation restores the screen to the way it looks in filename.
The scr_init() function reads the contents of filename and uses those contents to initialize the X/Open Curses data structures to what is
actually on screen. The next refresh operation bases its updates on this data, unless the terminal has been written to since filename was
saved or the terminfo capabilities rmcup and nrrmc are defined for the current terminal.
The scr_set() function combines scr_restore() and scr_init(). It informs the program that the contents of the file filename are what is
currently on the screen and that the program wants those contents on the screen.
RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR.
ERRORS
None.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
delscreen(3XCURSES), doupdate(3XCURSES), endwin(3XCURSES), getwin(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)
SunOS 5.11 5 Jun 2002 scr_dump(3XCURSES)