Sponsored Content
Top Forums Shell Programming and Scripting Linear data to column data..script help seeked Post 302350004 by ak835 on Wednesday 2nd of September 2009 01:23:02 PM
Old 09-02-2009
MySQL Linear data to column data..script help seeked

Hello

Take a look at following lines.
This is giving me an o/p all in one array where as i want the column to be printed.How can i do it?

e.g
I am getting:

1575028616......

whereas i want
1
5750
28616


I am writing this small piece and trying to get this column o/p in a CSV.

Code:
COLUMNS=2047 /usr/bin/ps -eo ppid | grep -v "PPID" > /tmp/ppid.txt
cat /tmp/ppid.txt | while read line
do
PPID=`echo $line |awk '{print $1}'`
echo $PPID
done

Kindly advice

Abhi
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Put raw data to column data

Dear all, I want below data to make it in column format.so i will see the data like this cdrID teleServiceCode chargedPartyNumber ... ... ... ... "egmailcom0w10ggzx00" 'sMS (5)' "716323770" "m17ifi5z30w0z6o7200" 'sMS (5)' ... (7 Replies)
Discussion started by: Nayanajith
7 Replies

2. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

3. 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

4. Shell Programming and Scripting

Replace data of one column with data on other file corresponding to transaction ID matched

Hi All, I have two files one of which having some mobile numbers and corresponding value whose sample content as follows: 9058629605,8.0 9122828964,30.0 And in second file complete details of all mobile numbers and sample content as follows and delimeter used is comma(,): ... (8 Replies)
Discussion started by: poweroflinux
8 Replies

5. UNIX for Advanced & Expert Users

Convert column data to row data using shell script

Hi, I want to convert a 3-column data to 3-row data using shell script. Any suggestion in this regard is highly appreciated. Thanks. (4 Replies)
Discussion started by: sktkpl
4 Replies

6. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

7. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

8. Shell Programming and Scripting

Change data in one column with data from another file's column

Hello, I have this file outputData: # cat /tmp/outputData __Capacity^6^NBSC01_Licences^L3_functionality_for_ESB_switch __Capacity^2100^NBSC01_Licences^Gb_over_IP __Capacity^1837^NBSC01_Licences^EDGE_BSS_Fnc __Capacity^1816^NBSC01_Licences^GPRS_CS3_and_CS4... (1 Reply)
Discussion started by: nypreH
1 Replies

9. 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

10. Shell Programming and Scripting

Linear Interpolation of CSV Columnar Data

I am trying to perform linear interpolation on three columns in a CSV file. When I run this code, I do not get any changes in the output (see Expected Output). What am I doing wrong here? Awk Code ' function interpolate(lat1, lon1, t1, lat2, lon2, t2, i) { for (i = 1; i... (2 Replies)
Discussion started by: hrrruser
2 Replies
funcolumnlookup(3)						SAORD Documentation						funcolumnlookup(3)

NAME
FunColumnLookup - lookup a Funtools column SYNOPSIS
#include <funtools.h> int FunColumnLookup(Fun fun, char *s, int which, char **name, int *type, int *mode, int *offset, int *n, int *width) DESCRIPTION
The FunColumnLookup() routine returns information about a named (or indexed) column. The first argument is the Fun handle associated with this set of columns. The second argument is the name of the column to look up. If the name argument is NULL, the argument that follows is the zero-based index into the column array of the column for which information should be returned. The next argument is a pointer to a char *, which will contain the name of the column. The arguments that follow are the addresses of int values into which the following information will be returned: o type: data type of column: o A: ASCII characters o B: unsigned 8-bit char o I: signed 16-bit int o U: unsigned 16-bit int (not standard FITS) o J: signed 32-bit int o V: unsigned 32-bit int (not standard FITS) o E: 32-bit float o D: 64-bit float o mode: bit flag status of column, including: o COL_ACTIVE 1 is column activated? o COL_IBUF 2 is column in the raw input data? o COL_PTR 4 is column a pointer to an array? o COL_READ 010 is read mode selected? o COL_WRITE 020 is write mode selected? o COL_REPLACEME 040 is this column being replaced by user data? o offset: byte offset in struct o n: number of elements (i.e. size of vector) in this column o width: size in bytes of this column If the named column exists, the routine returns a positive integer, otherwise zero is returned. (The positive integer is the index+1 into the column array where this column was located.) If NULL is passed as the return address of one (or more) of these values, no data is passed back for that information. For example: if( !FunColumnLookup(fun, "phas", 0, NULL NULL, NULL, NULL, &npha, NULL) ) gerror(stderr, "can't find phas column "); only returns information about the size of the phas vector. SEE ALSO
See funtools(7) for a list of Funtools help pages version 1.4.2 January 2, 2008 funcolumnlookup(3)
All times are GMT -4. The time now is 10:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy