Sponsored Content
Top Forums UNIX for Advanced & Expert Users Convert column data to row data using shell script Post 302650983 by migurus on Monday 4th of June 2012 04:15:36 PM
Old 06-04-2012
tr command is very handy, man tr and check all the features.
As a simplistic example:

Code:
$ echo "Col1 Col2 Col3"
Col1 Col2 Col3
$
$ echo "Col1 Col2 Col3" | tr ' ' '\n'
Col1
Col2
Col3
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert data befor some field in a row of data depending up on values in row

Hi I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example. The original data record should be some thing like this 60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies

2. Shell Programming and Scripting

Convert row data to column data

Hi Guys, I have a file as follows: a 1 b 786 c 90709 d 99 a 9875 b 989 c 887 d 111 I want: a 1 9875 b 786 989 (3 Replies)
Discussion started by: npatwardhan
3 Replies

3. Shell Programming and Scripting

How to convert 2 column data into multiple columns based on a keyword in a row??

Hi Friends I have the following input data in 2 columns. SNo 1 I1 Value I2 Value I3 Value SNo 2 I4 Value I5 Value I6 Value I7 Value SNo 3 I8 Value I9 Value ............... ................ SNo N (1 Reply)
Discussion started by: ks_reddy
1 Replies

4. Shell Programming and Scripting

row to column and position data in to fixed column width

Dear friends, Below is my program and current output. I wish to have 3 or 4 column output in order to accomodate in single page. i do have subsequent command to process after user enter the number. Program COUNT=1 for MYDIR in `ls /` do VOBS=${MYDIR} echo "${COUNT}. ${MYDIR}" ... (4 Replies)
Discussion started by: baluchen
4 Replies

5. Shell Programming and Scripting

Convert XML to Data File in Shell Script

Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ... (8 Replies)
Discussion started by: ragha81
8 Replies

6. Shell Programming and Scripting

Moving data from a specified column/row to another column/row

Hello, I have an input file like the following: 11_3_4 2_1_35 3_15__ _16989 Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Discussion started by: jl487
2 Replies

7. Shell Programming and Scripting

By using AWK can I convert matrice shaped data to a row ?

Hello, I have output in the matrice form , for example: 1 2 3 4 a b c d jim joe sue tom how can I convert this line-column data into a row as follows 1 2 3 4 a b c d jim joe sue tom thank you (14 Replies)
Discussion started by: rpf
14 Replies

8. Shell Programming and Scripting

awk - script help: column to row format of data allignment?

Experts Good day, I have the following data, file1 BRAAGRP1 A2X B2X C2X D2X BRBGRP12 A3X B3X Z10 D09 BRC1GRP2 LO01 (4 Replies)
Discussion started by: rveri
4 Replies

9. Shell Programming and Scripting

Convert Data from Column to Row

Hi FileA.txt E_TIM 16, ETE 15, EOND 26, EEC 81, E_1 un, E_2 un, E_3 un, E_4 284, E_TIM 17, ETE 15, EOND 29, EEC 82, E_1 un, E_2 un, E_3 un, E_4 249, (6 Replies)
Discussion started by: asavaliya
6 Replies

10. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies
IMAP_MAILBOXMSGINFO(3)							 1						    IMAP_MAILBOXMSGINFO(3)

imap_mailboxmsginfo - Get information about the current mailbox

SYNOPSIS
object imap_mailboxmsginfo (resource $imap_stream) DESCRIPTION
Checks the current mailbox status on the server. It is similar to imap_status(3), but will additionally sum up the size of all messages in the mailbox, which will take some additional time to execute. PARAMETERS
o $ imap_stream -An IMAP stream returned by imap_open(3). RETURN VALUES
Returns the information in an object with following properties: Mailbox properties +--------+----------------------------------------+ | Date | | | | | | | date of last change (current datetime) | | | | |Driver | | | | | | | driver | | | | |Mailbox | | | | | | | name of the mailbox | | | | | Nmsgs | | | | | | | number of messages | | | | |Recent | | | | | | | number of recent messages | | | | |Unread | | | | | | | number of unread messages | | | | |Deleted | | | | | | | number of deleted messages | | | | | Size | | | | | | | mailbox size | | | | +--------+----------------------------------------+ Returns FALSE on failure. EXAMPLES
Example #1 imap_mailboxmsginfo(3) example <?php $mbox = imap_open("{imap.example.org}INBOX", "username", "password") or die("can't connect: " . imap_last_error()); $check = imap_mailboxmsginfo($mbox); if ($check) { echo "Date: " . $check->Date . "<br /> " ; echo "Driver: " . $check->Driver . "<br /> " ; echo "Mailbox: " . $check->Mailbox . "<br /> " ; echo "Messages: " . $check->Nmsgs . "<br /> " ; echo "Recent: " . $check->Recent . "<br /> " ; echo "Unread: " . $check->Unread . "<br /> " ; echo "Deleted: " . $check->Deleted . "<br /> " ; echo "Size: " . $check->Size . "<br /> " ; } else { echo "imap_mailboxmsginfo() failed: " . imap_last_error() . "<br /> "; } imap_close($mbox); ?> PHP Documentation Group IMAP_MAILBOXMSGINFO(3)
All times are GMT -4. The time now is 01:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy