Data displayed in two lines


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Data displayed in two lines
# 1  
Old 02-04-2009
Data displayed in two lines

Hi,

I am a newbie to both Linux and this forum.

I was trying to pull out the data from a database but it is not showing up in the multiple lines, with my limited knowledge i linux u tried to format this but wasn't exactly getting what i wanted.


The screenshot below shows my problem.

Image

I want this result to be displayed in one line. In other programming languages we can do this by reading each line (till eol character) and display the content line by line. But i am not sure how it is possible in shell scripting.

I look forward to your response.

Thanks
Ninjaa
# 2  
Old 02-04-2009
Try this:

Code:
awk '{ORS=NR%2?" ":"\n"}1' file

Regards
# 3  
Old 02-06-2009
Thanks mate!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Tee doesn't write all displayed data into text file

"Debain 9 - LXDE" I execute follow line in the bash terminal: /ts3/server/ts3server_startscript.sh start createinifile=1 | tee -a /ts3/server/key.txt The displayed output looks like follow: My key.txt file looks like follow: How can i save the whole displayed text in my file? Why does... (5 Replies)
Discussion started by: int3g3r
5 Replies

2. Shell Programming and Scripting

Set the number of lines to be displayed on nedit!!

Dear Help, I have been encountering a strange problem. When I run a shell script, I do expect the output number of lines to be 12000 and it runs fine on one my linux w/s.But it just terminate at line 2704 on another linux machine. I have put 'nedit text.file' at the last part of the script,... (5 Replies)
Discussion started by: Indra2011
5 Replies

3. UNIX for Dummies Questions & Answers

Comparing lines of data

Total UNIX Rookie, but I'm learning. I have columns of integer data separated by spaces, and I'm using a Mac terminal. What I want to do: 1. Compare "line 1 column 2" (x) to "line 2 column 2" (y); is y-x>=100? 2. If yes, display difference and y's line number 3. If no, increment x and y by... (9 Replies)
Discussion started by: markymarkg123
9 Replies

4. Shell Programming and Scripting

In Outlook spooled file data is not getting displayed properly

I am fetching a database table in spool file and send that details as a email. The Spooled file content is properly being displayed in UNIX. See Example below : ID|FILENAME |ABCDEF_DT |PROCESSED_DT |STATUS... (4 Replies)
Discussion started by: Ravi_007
4 Replies

5. Shell Programming and Scripting

Perl : blank lines are displayed in the output after deleting few rows from excel

I am working on an assignment to pull all the records from excel sheet programatically and use the data for further calculations. In this process, I first defined 10 records in excel sheet and executed the below code. In the first run it is OK. But after deleting last few rows in excel sheet and... (0 Replies)
Discussion started by: giridhar276
0 Replies

6. Shell Programming and Scripting

Help in replacing two blank lines with two lines of diff data

Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script... I used sed to search a line and insert two blank lines after the searchd line using the following sed command. sed "/data/{G;G;}/" filename . In the file, after data tag, two lines got inserted blank lines..... (4 Replies)
Discussion started by: arjun_arippa
4 Replies

7. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

8. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not as an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

9. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? ... (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

10. Homework & Coursework Questions

Option to save data thats displayed?

Im trying to come up with a simple shell script to display info about the current user.`pwd`; `date` ; `who am i` I want to give the option to save all the data thats display by the commands to a log file. With a timestamp as the name of the file This is where im stuck echo "Would you like to... (3 Replies)
Discussion started by: eddieq20
3 Replies
Login or Register to Ask a Question