I am very new to Unix. What are the similiarities and differences between ScoUnix and AIX5 if any? Where might i find the information? Which is better? (1 Reply)
i want to know the similarities and disimilarities of Unix and Windows file systems . methods of file , file orgsnization , meaning of file extension , file and disk fragments :confused::confused: (1 Reply)
Hello Everybody!!!!!!!!! Request you to help me with the below mentioned issue:
I have 2 files say,
File 1:
a|4|7
b|3|2
c|8|8
d|8|9
File 2:
a|4|6
b|2|2
c|8|8
d|9|8
The third file(output file) should have:
Data mismatch in row 1 column 3
Data mismatch in row 2 coumn 2
Data... (3 Replies)
Hello everyone!!!!! Need some help on inserting data in a file columnwise.
Example:
File1:
1|AAA|25|2
5|qqe|20|7
4|wer|31|81
I need to create a second file in which data can be inserted in a columnwise manner i.e.
File2:
AAA|25|1|2
qqe|20|5|7
wer|31|4|81
The order of columns in... (1 Reply)
Hello everyone!!!!! Need some help on inserting data in a file columnwise.
Example:
File1:
1|AAA|25|2
5|qqe|20|7
4|wer|31|81
I need to create a second file in which data can be inserted in a columnwise manner i.e.
File2:
AAA|25|1|2
qqe|20|5|7
wer|31|4|81
The order of columns in... (1 Reply)
Hi ,
I have a CSV file that has around 50K records in it. I have to delete all the duplicate rows from the file except one, depending upon data in column4.
Lets say there are 3 rows for 'column4data' in the file. I have to retain only that line which has the smallest date value in column2.... (3 Replies)
Hi All,
I want to trim each columns leading & trailing (like sql trim function) of a ',' separated file..
I've a file like this..
manab , c gi
lucky , home
babu , maa
I want the output as
manab,c gi
lucky,home
babu,maa
A one liner would be a great help. (2 Replies)
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (4 Replies)
I have two files which has component name and version number separated by a space
cat file1
com.acc.invm:FNS_PROD 94.0.5
com.acc.invm:FNS_TEST_DCCC_Mangment 94.1.6
com.acc.invm:FNS_APIPlat_BDMap 100.0.9
com.acc.invm:SendEmail 29.6.113
com.acc.invm:SendSms 12.23.65
cat file2 ... (8 Replies)
Discussion started by: rakeshtomar82
8 Replies
LEARN ABOUT OSX
getline
GETLINE(3) BSD Library Functions Manual GETLINE(3)NAME
getdelim, getline -- get a line from a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
ssize_t
getdelim(char ** restrict linep, size_t * restrict linecapp, int delimiter, FILE * restrict stream);
ssize_t
getline(char ** restrict linep, size_t * restrict linecapp, FILE * restrict stream);
DESCRIPTION
The getdelim() function reads a line from stream, delimited by the character delimiter. The getline() function is equivalent to getdelim()
with the newline character as the delimiter. The delimiter character is included as part of the line, unless the end of the file is reached.
The caller may provide a pointer to a malloced buffer for the line in *linep, and the capacity of that buffer in *linecapp. These functions
expand the buffer as needed, as if via realloc(). If linep points to a NULL pointer, a new buffer will be allocated. In either case, *linep
and *linecapp will be updated accordingly.
RETURN VALUES
The getdelim() and getline() functions return the number of characters written, excluding the terminating NUL character. The value -1 is
returned if an error occurs, or if end-of-file is reached.
EXAMPLES
The following code fragment reads lines from a file and writes them to standard output. The fwrite() function is used in case the line con-
tains embedded NUL characters.
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, fp)) > 0)
fwrite(line, linelen, 1, stdout);
ERRORS
These functions may fail if:
[EINVAL] Either linep or linecapp is NULL.
[EOVERFLOW] No delimiter was found in the first SSIZE_MAX characters.
These functions may also fail due to any of the errors specified for fgets() and malloc().
SEE ALSO fgetln(3), fgets(3), malloc(3)STANDARDS
The getdelim() and getline() functions conform to IEEE Std 1003.1-2008 (``POSIX.1'').
HISTORY
These routines first appeared in FreeBSD 8.0.
BUGS
There are no wide character versions of getdelim() or getline().
BSD November 30, 2010 BSD