Sponsored Content
Top Forums Shell Programming and Scripting Read input write multply output with creteria Post 303014522 by RudiC on Wednesday 14th of March 2018 04:13:10 AM
Old 03-14-2018
It will create as many files as different criteria are present in the input file. Should these become more than ther OPEN_MAX system configuration parameter, append (>>) to the respective output files and close after each write.
 

10 More Discussions You Might Find Interesting

1. Programming

read input-process-output

Can you help me ? I want to write a program ,which can open a input file (input.txt) and run as child process ,then write to output file (output.txt)....... char inFile="input.txt"; char outFile="output.txt"; int main(int argc, char **argv) { pid_t pid=1; int no=0; // no. of... (5 Replies)
Discussion started by: cupid1575
5 Replies

2. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

3. Shell Programming and Scripting

Script to read input and output files and child scripts

I have a directory where i have *.sas; *.pl;*.sh and *.c scripts I need to find out what are the child scripts and input output files for each script: say I have a shell script which calls a perl script and a sas script: In my first line I want I a) the parent script name; b) the... (1 Reply)
Discussion started by: ramky79
1 Replies

4. Shell Programming and Scripting

Read input and output redirection filename within a script

Hello everyone, My requirement is that within a script I need to construct the command line exactly that it was invoked with. For example : sh a.sh arg1 arg2 arg3 < input.txt > output.txt Now within a.sh, I construct a file which has these contents " sh a.sh arg1 arg2 arg3 < input.txt >... (8 Replies)
Discussion started by: hedonist12
8 Replies

5. Shell Programming and Scripting

Print output and read input on same line

How do I print output and read input on the same line in ksh? echo Hello, what is your name? read name (1 Reply)
Discussion started by: robin_simple
1 Replies

6. Shell Programming and Scripting

shell, read table and write the value for each factor to output

Hey guyz, I have a table like this: 1 A=#;B=#;C=# 2 A=#;C=#;D=#;E=#;E=# 3 B=#;B=#;B=#;D=# # are just some numbers. I want to have the output like this: * 1 2 3 A # # NA B # NA # C # # NA D NA # # E NA # NA So basically, I wanna know in each of the rows in my input (which... (9 Replies)
Discussion started by: @man
9 Replies

7. Shell Programming and Scripting

Read user input, Encrypt the data and write to file

Hi, can some one help me how to encrypt and decrypt a file. AIM: reade user input, encrypt it and save it to file. while decryption read the encrypted file decrypt it and save the output in some variable. Example: consider we have Credentials.txt file with content username: password... (5 Replies)
Discussion started by: saichand1985
5 Replies

8. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

9. Shell Programming and Scripting

awk - read from a file and write conditional output

I have a file, which has '|' as separator; I need to read each line from that file and produce output to another file. While reading, I have certain condition on few specific columns (like column3 ='good'); only those lines will be processed. (3 Replies)
Discussion started by: mady135
3 Replies

10. Shell Programming and Scripting

ksh - Read input from file and output CSV i same row

Hello I have the following output and want the output to look: FROM: GigabitEthernet0/0 is up, line protocol is up 1 input errors, 0 CRC, 0 frame, 1 overrun, 0 ignored 275 output errors, 0 collisions, 3 interface resets GigabitEthernet0/1 is up, line protocol is up 0... (4 Replies)
Discussion started by: JayJay2018
4 Replies
fopen(3S)																 fopen(3S)

NAME
fopen(), freopen(), fdopen() - open/reopen a stream file or convert file to stream SYNOPSIS
DESCRIPTION
Opens the file named by pathname and associates a stream with it. returns a pointer to the structure associated with the stream. substitutes the named file in place of the open stream. The original stream is closed, regardless of whether the open ultimately succeeds. returns a pointer to the struc- ture associated with stream and makes an implicit call to (see ferror(3S)). After a successful call to the orientation of the stream is cleared (see orientation(5)). is typically used to attach the preopened streams associated with and to other files. associates a stream with a file descriptor. File descriptors are obtained from or (see open(2), dup(2), creat(2), and pipe(2)), which open files but do not return pointers to a structure stream. Streams are necessary input for many of the Section(3S) library routines. The type of stream must agree with the mode of the open file. The meanings of type used in the call are exactly as specified above, except that and do not cause truncation of the file. pathname Points to a character string containing the name of the file to be opened. type Character string having one of the values listed below. The in the following values has no effect. It exists to distin- guish binary files from text files; however, there is no distinction between these types of files on UNIX systems (it is required for ISO C standard conformance). r or rb open file for reading w or wb truncate to zero length or create file for writing a or ab append; open file for writing at end of file, or create file or writing r+, rb+, or r+b open file for update (reading and writing) w+, wb+, or w+b truncate file to zero length or create file for update a+, ab+, or a+b append; open or create file for update at end-of-file When a file is opened for update, both input and output can be done on the resulting stream. However, output cannot be directly followed by input without an intervening call to or to a file positioning function or and input cannot be directly followed by output without an intervening call to a file positioning function unless the input operation encounters end-of-file. When a file is opened for append (that is, when type is or it is impossible to overwrite information already in the file. All output is written at the end of the file, regardless of intervening calls to If two separate processes open the same file for append, each process can write freely to the file without fear of destroying output being written by the other. Output from the two processes will be inter- mixed in the file in the order in which it is written. Notes HP-UX binary file types are equivalent to their non-binary counterparts. For example, types and are equivalent. RETURN VALUE
Upon successful completion, and return a pointer to the stream. Otherwise, a null pointer is returned and is set to indicate the error. ERRORS
and fail if: The fildes argument is not a valid file descriptor. The type argument is not a valid mode. There is insufficient space to allocate a buffer. and fail if: Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by type are denied, or the file does not exist and write permission is denied for the parent directory of the file to be created. A signal was caught during or function. The named file is a directory and type requires write access. The calling process has attempted to exceed its open file limit. The length of the pathname string exceeds or a pathname component is longer than while is in effect. The system file table is full. The named file does not exist or the pathname argument points to an empty string. The directory or file system that would contain the new file cannot be expanded, the file does not exist, and it was to be created. A component of the path prefix is not a directory. The named file is a character special or block special file, and the device associated with the special file does not exist. The named file is a regular file and the size of the file cannot be represented correctly in an object of size in this environment. The named file resides on a read-only file system and type requires write access. Additional values can be set by the underlying call made from the and functions (see open(2)). SEE ALSO
creat(2), dup(2), open(2), pipe(2), fclose(3S), fgetpos64(3S), fseek(3S), popen(3S), setbuf(3S), orientation(5), thread_safety(5), glos- sary(9). STANDARDS CONFORMANCE
fopen(3S)
All times are GMT -4. The time now is 03:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy