Sponsored Content
Top Forums Shell Programming and Scripting Grep for NULL in a pipe delimited file Post 302097005 by aigles on Tuesday 21st of November 2006 05:15:45 AM
Old 11-21-2006
A grep for || doesn't select null field at start or end of line.
Try :

Code:
egrep '^\||\|\||\|$' somefile

Note: The egrep command is the same as the grep -E command.

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

convert a pipe delimited file to a':" delimited file

i have a file whose data is like this:: osr_pe_assign|-120|wg000d@att.com|4| osr_evt|-21|wg000d@att.com|4| pe_avail|-21|wg000d@att.com|4| osr_svt|-11|wg000d@att.com|4| pe_mop|-13|wg000d@att.com|4| instar_ready|-35|wg000d@att.com|4| nsdnet_ready|-90|wg000d@att.com|4|... (6 Replies)
Discussion started by: priyanka3006
6 Replies

2. Shell Programming and Scripting

count of null in pipe delimited txt file

Hi, I have a pipe delimited txt file which contains 17 fields per line/row. 16th field contains email id. I want to count the number of lines/rows that contains null in the 16th field. Plz find attached example data file. I'm looking for a command line/script which achieves this. ... (5 Replies)
Discussion started by: Sriranga
5 Replies

3. Shell Programming and Scripting

How to convert a space delimited file into a pipe delimited file using shellscript?

Hi All, I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted... AA ATIU2345098809 009697 005374 BB ATIU2345097809 005445 006518 CC ATIU9685098809 003215 003571 DD... (7 Replies)
Discussion started by: nithins007
7 Replies

4. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

5. Shell Programming and Scripting

Find for line with not null values at nth place in pipe delimited file

Hi, I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please. thanks in advance. (3 Replies)
Discussion started by: manikms
3 Replies

6. Shell Programming and Scripting

Grep:pipe delimited output

Hi, I am trying to search for a string in a file and print all the matched lines as pipe delimited format. My command is cat m_gid_trans.XML|grep -i '<TABLEATTRIBUTE NAME ="Lookup cache directory name"' The output I am getting is <TABLEATTRIBUTE NAME ="Lookup cache directory name"... (4 Replies)
Discussion started by: sampoorna
4 Replies

7. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

8. Shell Programming and Scripting

Replace pipe delimited column string to null

Hi All, I have a large dat file where each lines are pipe delimited values. I need to parse the file depending on the request. For example: sometimes I have told to remove all the values in the 7th column (this case remove values '3333' only from the first line and '3543' from the second line)... (4 Replies)
Discussion started by: express14
4 Replies

9. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies

10. UNIX for Dummies Questions & Answers

Check for not null column in a pipe delimited file

Hi, I have a requirement where I have to check whether the mandatory columns in a pipe delimited file is null and print error message. For eg, I have to check if the 3rd,5th,6th,7th and 8th column are null and print the message "<column name> is null". The data file will have aroung 100,000... (6 Replies)
Discussion started by: reshma15193
6 Replies
RFIO_POPEN(3)						      Rfio Library Functions						     RFIO_POPEN(3)

NAME
rfio_popen, rfio_pclose - start a process and open a pipe to it SYNOPSIS
#include <sys/types.h> #include "rfio_api.h" FILE *rfio_popen (const char *command, const char *type); int rfio_pclose (FILE *fs); DESCRIPTION
rfio_popen starts a process and opens a pipe to it. command is a pointer to a string specifying the shell command to be executed. type is a mode indicator for the pipe. One of the characters "r" or "w". rfio_pclose waits for the forked process to terminate and returns the exit status of the command. EXAMPLE
int c; FILE *rf; rf = rfio_popen (command, "r"); if (rf == NULL) { rfio_perror ("rfio_popen"); exit (1); } while ((c = rfio_pread (buf, 1, sizeof(buf), rf)) > 0) { ... } c = rfio_pclose (rf); RETURN VALUE
This routine returns NULL if the operation failed or a non-NULL pointer to a FILE structure if the operation was successful. If it fails, serrno variable is set appropriately. ERRORS
ENOMEM Not enough memory. EINVAL The mode provided is invalid. ECONNRESET Connection reset by peer ETIMEDOUT Connection timed out ECONNREFUSED Connection refused EHOSTUNREACH No route to host SENOSHOST Host unknown. SENOSSERV Service unknown. SEUMSG2LONG Command string too long. SECOMERR Communication error. SEE ALSO
rfio_pread(3), rfio_pwrite(3) AUTHOR
LCG Grid Deployment Team LCG
$Date: 2008/09/24 11:25:01 $ RFIO_POPEN(3)
All times are GMT -4. The time now is 06:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy