hello.. i m scripting in Perl and having issue writing the output in specific format..i read two files and run some commands and write output to one file. i want this to be a 2d table, File one has 48 rows and file two has 48 rows,
first i take one id from file one, and go to second file, loop... (2 Replies)
Hi All,
I have a requirement where I need to go to a directory, list all the files that start with person* (for eg) & read the most recent file from the list of files.
While browsing through the forum, i found that the command ls -t will list the files. I am trying to generate the output... (1 Reply)
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)
Hi everyone,
i have a file that I had grep'd from something else lets call it file1.txt which consists variable files and lines due to different scenarios/inputs
1782
9182
fe35
ac67
how can I print this in this manner?
1782,9182,fe35,ac67
also if i had piped the new output... (2 Replies)
Hi All,
i have the following command
df|awk '{print $5}'|grep /| egrep -v '^/$|/usr|/opt|/var/log|/home|/tmp'
output looks like:
/filesystem/number1
/filesystem/number2
/filesystem3
/possiblymoreoutput
i want the output to look like the below (either in a file or to output to... (3 Replies)
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)
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)
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)
Hello, I need to get few values from a XML file and output needs to be written in another file with pipe delimited format. The Header & Footer of the Pipe Delimited file will be constant.
The below is my sample XML file. I need to pull the values in between the XML tags <Operator_info to... (15 Replies)
Hello,
I need to split a pipe de-limited file based on the COLUMN 7 value . If the column value changes I need to split the file
Source File
Payment|ID|DATE|TIME|CONTROLNUMBER|NUMBER|NAME|INDICATOR
42156974|1137937|10/1/2018|104440|4232|2054391|CARE|1... (9 Replies)
Discussion started by: rosebud123
9 Replies
LEARN ABOUT HPUX
pclose
popen(3S)popen(3S)NAME
popen(), pclose() - initiate pipe I/O to/from a process
SYNOPSIS DESCRIPTION
creates a pipe between the calling program and a command to be executed by the POSIX shell, (see sh-posix(1)).
The arguments to are pointers to null-terminated strings containing, respectively, a shell command line and an I/O mode, either for reading
or for writing.
returns a stream pointer such that one can write to the standard input of the command if the I/O mode is by writing to the file stream; and
one can read from the standard output of the command if the I/O mode is by reading from the file stream.
Because open files are shared, a type command can be used as an input filter and a type command as an output filter. If mode is other than
or the result is undefined.
A stream opened by should be closed by which waits for the associated process to terminate and returns the exit status of the command.
However, if a call caused the termination status to be unavailable to then returns -1 with errno set to This can happen in one of the fol-
lowing conditions:
o If the signal handler for is set to
o If the signal handler or another thread in the same process issues or call.
APPLICATION USAGE
After a stream is associated with a pipe by the stream is byte-oriented (see orientation(5)).
RETURN VALUE
Upon successful completion, returns a pointer to an open stream that can be used to read or write to the pipe. Otherwise, it returns a
NULL pointer if files or processes cannot be created and set errno to indicate the error. The success of the command execution can be
checked by examining the return value of
Upon successful return, returns the termination status of the command language interpreter. Otherwise, returns -1 if stream is not associ-
ated with a command and set errno to indicate the error.
ERRORS
The function fails if:
The maximum number of file descriptors allowed are currently open.
The function fails if:
The status of the child process is not available.
WARNINGS
If the original and processes concurrently read or write a common file, neither should use buffered I/O because the buffering will not work
properly. Problems with an output filter can be forestalled by careful buffer flushing, e.g., with see fclose(3S).
SEE ALSO pipe(2), wait(2), fclose(3S), fopen(3S), system(3S), orientation(5), thread_safety(5).
STANDARDS CONFORMANCE popen(3S)