Hi,
I am looking for a method to get column13 to column 50 data from the 1st line of a multiline reord. The records are stored in a large file and are separated by newline. sample format is
(data in red is to be extracted)
<header>
A001dfhskhfkdsh hajfhksdhfjh... (3 Replies)
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
hi all,
when i try to start an applicationserver
for an example:
./kStart.sh > out.txt
so kStart.sh script will start the application server and write the details to out.txt
but in mycase... it is writing to out.txt and as well it is showing in the prompt also...
I want only the... (2 Replies)
Hi,
I have data in following format.
10001, John, Daves, Architecture, -2219
10002, Jim, Cirners, Businessman, -2219
1003, Tom, Katch, Engineer, -14003
I want to select the last column of the above given file and paste it on a different file in the following manner.
File TEST column... (11 Replies)
The script must ask the user to enter the user name and check whether the user exists in /etc/passwd (you must allow the partial usernames also). If the username exists, display the details as:
List of users
Login Name:
User ID:
... (3 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
I have a flatfile A.txt
date|products|notes|location
121117|a108|this is a test|florida
121118|b111|just test it|tampa
How do i write an awk to create a file name as location.txt and have products:notes
awk -F'|' '{ print $2 ":" $3 }' A.txt > $4.txt
I am sure it cannot write to... (5 Replies)
Trying to use perl to output specific fields from all text files in a directory to one new file. Each text file on a new line. The below seems to work for one text file but not more. Thank you :).
perl -ne 's/^#//; @n = (6, 7, 8, 16); print if $. ~~ @n' *.txt > out.txt
format of all text... (2 Replies)
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies
LEARN ABOUT HPUX
popen
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)