Sponsored Content
Top Forums Shell Programming and Scripting How to ignore Pipe in Pipe delimited file? Post 302842219 by RudiC on Thursday 8th of August 2013 04:31:14 PM
Old 08-08-2013
Maybe you can adapt this post to fit your needs? It's for commas in comma delimited fields, but it should do the task after some fiddling...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to split pipe delimited file

I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help |sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl||||*|... (4 Replies)
Discussion started by: njgirl
4 Replies

2. Shell Programming and Scripting

How to generate a pipe ( | ) delimited file?

:)Hi Friends, I have certain log files extracted. I want it to be converted in pipe ( | ) delimited file. How do i do it? E.g. Account Balance : 123456789 Rs O/P (Account Balance: | 123456789 Rs) Account Balance (Last) > 987654321 Rs O/P (Account Balance (Last) | 987654321 Rs) Last... (5 Replies)
Discussion started by: anushree.a
5 Replies

3. UNIX for Dummies Questions & Answers

Extracting from pipe delimited file.

Hey, I am new to regualar expression. I wanted to extract the information from a pipe delimited file which has some entries like L|S2CMG1B|||-11178399||1|-8.65|IRCSH|BOND||||N|S|IRDL|AUD||CRP|STD|CRP|M|0|1|||CSH||||OTHER|01|DE|KFW|50418Y9T5|||||||||||2|||||| In this I want to extract the... (1 Reply)
Discussion started by: leepan2008
1 Replies

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

5. UNIX for Dummies Questions & Answers

Delete last value from pipe delimited file

I have a large(ish) pipe delimited file. The last line of the file contains a total row count and a checksum: END|1537451|1328569446 After making other adjustments to the file, I need to strip out the checksum and apply a new value - I have a script to generate the checksum and 'cat' it... (3 Replies)
Discussion started by: relentl3ss
3 Replies

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

7. UNIX for Dummies Questions & Answers

Reading a pipe delimited file

Hi Guys, i am reading a pipe delimited file using awk command. I have tested the gawk separately. it was fine. But when i execute the script. i am getting the following error saying command not found. Can somebody point out as what i am doing wrong. Cheers!!! (3 Replies)
Discussion started by: mac4rfree
3 Replies

8. UNIX for Advanced & Expert Users

Check Whether File is Pipe Delimited

Can anybody help me how to check whether a file is Pipe delimited or not? (1 Reply)
Discussion started by: Allwin333
1 Replies

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

10. 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
FBB::Pipe(3bobcat)						   Error handler						FBB::Pipe(3bobcat)

NAME
FBB::Pipe - Defines a system level pipe SYNOPSIS
#include <bobcat/pipe> Linking option: -lbobcat DESCRIPTION
FBB::Pipe objects may be used to construct a pipe. FBB::Pipe objects offer a simple interface to the reading and writing ends of pipes. FBB::Pipe objects are object-wrappers around the pipe(2) system call. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
- CONSTRUCTORS
o Pipe(): The default Pipe() constructor constructs a basic pipe, calling pipe(2). This constructor throws an Errno exception if the default Pipe constructor did not properly complete. The thrown Errno object's which() member shows the system's errno value set by the failing pipe(2) function. o Pipe(int const *fd): This constructor expects two file descriptors, which already define a pipe, stored at fd. Following the construction of the Pipe object the array at by fd is no longer used by the Pipe object. The copy constructor is available. Note that when the pipe goes out of scope, no close(2) operation is performed on the pipe's ends. If the pipe should be closed by the desc- tructor, derive a class from Pipe(3bobcat), whose destructor performs the required closing-operation. MEMBER FUNCTIONS
o int readFd() const: Returns the pipe's file descriptor that is used for reading o void readFrom(int filedescriptor): Sets up redirection from the internal read filedescriptor to the given filedescriptor: information is read from the FBB::Pipe object when reading from the provided filedescriptor. o void readFrom(int const *filedescriptors, size_t n): Sets up redirection from the internal read filedescriptor to the given filedescriptors: information is read from the FBB::Pipe object when reading from any of the n provided filedescriptors (experimental). o int readOnly(): Closes the writing end of the pipe, returns the reading end's file descriptor. o void verify() const: Obsoleted, will be removed in a future Bobcat release. o int writeFd() const: Returns the pipe's file descriptor that is used for writing o void writtenBy(int filedescriptor): Sets up redirection from the internal write filedescriptor to the given filedescriptor: information is written to the FBB::Pipe object when writing to the provided filedescriptor. o void writtenBy(int const *filedescriptors, size_t n): Sets up redirection from the internal write filedescriptor to the given filedescriptors: information is written to the FBB::Pipe object when writing to each of the n provided filedescriptors. o int writeOnly(): Closes the reading end of the pipe, returns the writing end's file descriptor. PROTECTED ENUMERATION
The RW protected enumeration has the following elements: o READ: The index in d_fd[] (see below) of the element holding the pipe's reading file descriptor; o WRITE: The index in d_fd[] (see below) of the element holding the pipe's writing file descriptor PROTECTED DATA
o int d_fd[2]: The array holding the pipe's file descriptors. The READ element contains the pipe's reading file descriptor, the WRITE element con- tains the pipe's writing file descriptor, EXAMPLE
#include <bobcat/pipe> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <iostream> #include <string> using namespace std; using namespace FBB; int main() { Pipe p; // construct a pipe cout << "Read file descriptor: " << p.getReadFd() << endl; cout << "Write file descriptor: " << p.getWriteFd() << endl; int pid = fork(); if (pid == -1) return 1; if (!pid) //child { p.readFrom(STDIN_FILENO); // read what goes into the pipe string s; getline(cin, s); cout << "CHILD: Got `" << s << "'" << endl; getline(cin, s); cout << "CHILD: Got `" << s << "'" << endl; return 0; } p.writtenBy(STDOUT_FILENO); // write to the pipe via cout cout << "first line" << endl; cout << "second line" << endl; waitpid(pid, 0, 0); return 0; } FILES
bobcat/pipe - defines the class interface SEE ALSO
bobcat(7), pipe(2), mkfifo(3) BUGS
Note that when the pipe goes out of scope, no close(2) operation is performed on the pipe's ends. If the pipe should be closed by the desc- tructor, derive a class from Pipe(3bobcat), whose destructor performs the required closing-operation. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::Pipe(3bobcat)
All times are GMT -4. The time now is 07:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy