hi..
you can use fgets to read chunks of data into a string.
the code can be around like this
//likewise you can store the value of user too.
check the manual for fgets.
Since the length of the email address could be variable the strtok method is preferred.
Hello there
I need to find a string in an file, and then copy to a new file from the previous 6 lines to 41 lines after the string.
So, what i need to do , and just don't know how, is to find the string and copy 48 lines where the string would be in the 7th line.
I don't know if i can do it with... (10 Replies)
I'm trying to get a script to copy a url then put it in a different place in the file.
Example is currently the script goes to a site takes the urls on it and then puts them into an html file. Only thing is I want to make them into links.
So currently lynx goes to the page takes out the urls.... (6 Replies)
Hi! just want to seek help on this:
i have a file wherein i want to find a string and copy the string after that and paste that other string to a new file.
ex:
TOTAL 123456
find "TOTAL" and copy "123456"
and paste "123456" to a new file
NOTE: there are many "TOTAL" strings on that... (12 Replies)
Hi
Does anybody know if there is a utility/command in ksh which would allow to copy/insert the contents of one string into certain positions of the other?
for example:
A=" ABCDEF "
B="HHH"
I need to insert contents of string "B" into string "A" from position 3 to 5, so... (3 Replies)
Hi guys
I've got two columns, PRODUCT and BRAND, the Brand column currently has the first word of each product, I've acheived this by using SED to copy the first word of the PRODUCT column, however you run into trouble when the brand has more than one word, i.e. 'Weight Watchers'.
Is there... (22 Replies)
i have a file1 with many lines. i have a script that will let me input a string. for example, APPLE. what i need to do is to copy all lines from file1 where i can find APPLE or any string that i specify and paste in on file 2
thanks in advance! (4 Replies)
Hi Folks,
Anybody has an idea how to split string based on separator _ (underscore) in Expect programming language?
e.g.if string is scmid1_scmid2 , i need to separate these two strings as scmid1 and scmid2.
Thanks in advance.
Sanket (1 Reply)
HI
Input A.txt
ABC907 ABC907_1B_9
ABC985 ABC985_1A_9
ABC985 ABC985_1B_9
ABC985 ABC985_1C_9
ABC05037 ABC05037_1A_9
ABC05037 ABC05037_1B_9
Base of column 2 last third char.
If It is A the 1,if B then 2 If C then 3
File B.txt
ABC907 ABC907_1B_9 2
ABC985 ABC985_1A_9 1
ABC985... (8 Replies)
OS version: RHEL 6.7
Shell : Bash
I have a file like below. It has 500K lines.
I want to extract TAG_IDs shown in single quote at the end to copied to another file. As if I had copied the TAG_IDs using block select (Column Select) in modern text editor
$ cat file.txt
UPDATE TAGREF SET... (9 Replies)
Discussion started by: John K
9 Replies
LEARN ABOUT DEBIAN
explain_fgets_or_die
explain_fgets_or_die(3) Library Functions Manual explain_fgets_or_die(3)NAME
explain_fgets_or_die - input of strings and report errors
SYNOPSIS
#include <libexplain/fgets.h>
char *explain_fgets_or_die(char *data, int data_size, FILE *fp);
DESCRIPTION
The explain_fgets_or_die function is used to call the fgets(3) system call. On failure an explanation will be printed to stderr, obtained
from explain_fgets(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_fgets_or_die(data, data_size, fp);
data The data, exactly as to be passed to the fgets(3) system call.
data_size
The data_size, exactly as to be passed to the fgets(3) system call.
fp The fp, exactly as to be passed to the fgets(3) system call.
Returns:
This function only returns on success; data when a line is read, or NULL on end-of-file. On failure, prints an explanation and
exits.
SEE ALSO fgets(3)
input of strings
explain_fgets(3)
explain fgets(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_fgets_or_die(3)