I'm trying to write a program that will open an existing file supplied by the command line argument and then replace words with "We" or "we" by "I" and "a" or "A" by "The". When I run the program it reads the file, changes the word but re writes it on a new line with only the replaced words not the whole sentence. Would anyone be able to help me? I also have to use open and read not fopen for example.
Yes it would rewrite on the newline and that too with only the replaced words not the whole sentence.
In your code where have you, instructed to write the whole sentence? Only the replacement is effected as follows
Quote:
write(in_fd, "I", strlen("I"));
try the following code,
not well tested, can be optimized, would server only as an example or starter;modify input/output file accordingly
>cat src
we source of power
We ultimate source of power
of all that a possible
neutral of all A neurons
>cat dest I source of power I ultimate source of power
of all that The possible
neutral of all The neurons
I really hate to do this, but I am completely stumped. I have to create a sed script that will change the abbreviations in a file to the full word. I really just have no idea where to start. All I want is a starting point as well no actual complete answer. Thank you for your time in advance.
... (4 Replies)
Hi, I have am using a file that contains names that I want to replace.
Basically file 1 looks like this
jack
joe
james
john
I have another file (file 2) that looks like this
jack 2345
joe 6848
james 3342
john 3432
Basically I want to replace column1 from file1... (4 Replies)
Hello,
I have a complex problem. I have a file in which words have been joined together:
Theboy ranslowly
I want to be able to correctly split the words using a lookup file in which all the words occur:
the
boy
ran
slowly
slow
put
child
ly
The lookup file which is meant for look up... (21 Replies)
Hello All
Probably this is very simple for you but I cant figure it out
I have to replace "No Header" with "Output Field Names"
I/P file
<ATTRIBUTE NAME ="Header Options" VALUE ="No Header"/>
O/P needed
<ATTRIBUTE NAME ="Header Options" VALUE = "Output Field Names"> (4 Replies)
Dear all,
I am working with names and I have a large file of names in which some words are written together (upto 4 or 5) and their corresponding single forms are also present in the word-list.
An example would make this clear
annamarie
mariechristine
johnsmith
johnjoseph smith
john
smith... (8 Replies)
I have an assignment and I am not sure what to do.
In Unix, I use PuTTY
change the semicolon (;) to a period, and capitalize the first letter of the word immediately after it.
I know change command is M-% and "." so only one semicolon is changed but I am not sure how to... (1 Reply)
Hi ,
I need to count the number of errors associated with the two words occurring in the file. It's about counting the occurrences of the word "error" for where is the word "index.js". As such the command should look like. Please kindly help. I was trying: grep "error" log.txt | wc -l (1 Reply)
Hello,
I would like to change my setting in a file to the setting that user input.
For example, by default it is
ONBOOT=ON
When user key in "YES", it would be
ONBOOT=YES
--------------
This code only adds in the entire user input, but didn't replace it.
How do i go about... (5 Replies)
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
LEARN ABOUT SUNOS
mlib_signalsplit_s16_s16s
mlib_SignalSplit_S16_S16S(3MLIB) mediaLib Library Functions mlib_SignalSplit_S16_S16S(3MLIB)NAME
mlib_SignalSplit_S16_S16S - split
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_SignalSplit_S16_S16S(mlib_s16 *ch0, mlib_s16 *ch1, const mlib_s16 *src, mlib_s32 n);
DESCRIPTION
The following function splits a stereo signal array into two signal arrays.
PARAMETERS
The function takes the following arguments:
ch0 Destination signal array of Channel 0.
ch1 Destination signal array of Channel 1.
src Source stereo signal array. src[2*i] contains Channel 0, and src[2*i+1] contains Channel 1.
n Number of samples in the source signal array.
RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO mlib_SignalMerge_S16S_S16(3MLIB), attributes(5)SunOS 5.10 9 Nov 2004 mlib_SignalSplit_S16_S16S(3MLIB)