12-16-2015
Hi,
Thanks, It works fine with grep command.
Ashok
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
How to output the duplicate record to another file. We say the record is duplicate based on a column whose position is from 2 and its length is 11 characters.
The file is a fixed width file.
ex of Record:
DTYU12333567opert tjhi kkklTRG9012
The data in bold is the key on which... (1 Reply)
Discussion started by: Qwerty123
1 Replies
3. Shell Programming and Scripting
Hi,
I have a fixed width text file without any header row. One of the columns contains a date in YYYYMMDD format.
If the original file contains 3 dates, I want my shell script to split the file into 3 small files with data for each date.
I am a newbie and need help doing this. (14 Replies)
Discussion started by: bhanja_trinanja
14 Replies
4. Shell Programming and Scripting
Dear members..
I have a fixed width file. Requirement is as below:-
1. Scan each record from this fixed width file
2. Check for value under field no "6" equals to "ABC". If yes, then filter this record into the output file
Please suggest a unix command to achieve this, my guess awk might... (6 Replies)
Discussion started by: sureshg_sampat
6 Replies
5. UNIX for Dummies Questions & Answers
I have a text file where the second column is a list of numbers going from small to large. I want to extract the rows where the second column is smaller than or equal to 0.0001.
My input:
rs10082730 9e-08 12 46002702
rs2544081 1e-07 12 46015487
rs1425136 1e-06 7 35396742
rs2712590... (1 Reply)
Discussion started by: evelibertine
1 Replies
6. UNIX for Dummies Questions & Answers
I have a space delimited text file. I want to extract rows where the third column has 0 as a value and write those rows into a new space delimited text file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies
7. Shell Programming and Scripting
Hi,
I am unable to find the right option to extract the data in the fixed width file.
sample data
abcd1234xgyhsyshijfkfk
hujk9876 io xgla
loki8787eljuwoejroiweo
dkfj9098 dja
Search based on position 8-9="xg" and print the entire row
output
... (4 Replies)
Discussion started by: onesuri
4 Replies
8. Linux
I have a .CSV file with the below format:
"column 1","column 2","column 3","column 4","column 5","column 6","column 7","column 8","column 9","column 10
"12310","42324564756","a simple string with a , comma","string with or, without commas","string 1","USD","12","70%","08/01/2013",""... (2 Replies)
Discussion started by: dhruuv369
2 Replies
9. Shell Programming and Scripting
hi,
i have a fixed width file with multiple columns and need to print data using awk command.
i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file.
but now i have a fixed width file like below:
7518 8269511BH 20141224951050N8262
11148 8269511BH... (5 Replies)
Discussion started by: kcdg859
5 Replies
LEARN ABOUT OPENDARWIN
funtablerowget
funtablerowget(3) SAORD Documentation funtablerowget(3)
NAME
FunTableRowGet - get Funtools rows
SYNOPSIS
#include <funtools.h>
void *FunTableRowGet(Fun fun, void *rows, int maxrow, char *plist,
int *nrow)
DESCRIPTION
The FunTableRowGet() routine retrieves rows from a Funtools binary table or raw event file, and places the values of columns selected by
FunColumnSelect() into an array of user structs. Selected column values are automatically converted to the specified user data type (and
to native data format) as necessary.
The first argument is the Fun handle associated with this row data. The second rows argument is the array of user structs into which the
selected columns will be stored. If NULL is passed, the routine will automatically allocate space for this array. (This includes proper
allocation of pointers within each struct, if the "@" pointer type is used in the selection of columns. Note that if you pass NULL in the
second argument, you should free this space using the standard free() system call when you are finished with the array of rows.) The third
maxrow argument specifies the maximum number of rows to be returned. Thus, if rows is allocated by the user, it should be at least of size
maxrow*sizeof(evstruct).
The fourth plist argument is a param list string. Currently, the keyword/value pair "mask=transparent" is supported in the plist argument.
If this string is passed in the call's plist argument, then all rows are passed back to the user (instead of just rows passing the filter).
This is only useful when FunColumnSelect() also is used to specify "$region" as a column to return for each row. In such a case, rows
found within a region have a returned region value greater than 0 (corresponding to the region id of the region in which they are located),
rows passing the filter but not in a region have region value of -1, and rows not passing any filter have region value of 0. Thus, using
"mask=transparent" and the returned region value, a program can process all rows and decide on an action based on whether a given row
passed the filter or not.
The final argument is a pointer to an int variable that will return the actual number of rows returned. The routine returns a pointer to
the array of stored rows, or NULL if there was an error. (This pointer will be the same as the second argument, if the latter is
non-NULL).
/* get rows -- let routine allocate the row array */
while( (buf = (Ev)FunTableRowGet(fun, NULL, MAXROW, NULL, &got)) ){
/* process all rows */
for(i=0; i<got; i++){
/* point to the i'th row */
ev = buf+i;
/* rearrange some values. etc. */
ev->energy = (ev->pi+ev->pha)/2.0;
ev->pha = -ev->pha;
ev->pi = -ev->pi;
}
/* write out this batch of rows */
FunTableRowPut(fun2, buf, got, 0, NULL);
/* free row data */
if( buf ) free(buf);
}
As shown above, successive calls to FunTableRowGet() will return the next set of rows from the input file until all rows have been read,
i.e., the routine behaves like sequential Unix I/O calls such as fread(). See evmerge example code for a more complete example.
Note that FunTableRowGet() also can be called as FunEventsGet(), for backward compatibility.
SEE ALSO
See funtools(7) for a list of Funtools help pages
version 1.4.2 January 2, 2008 funtablerowget(3)