Sponsored Content
Special Forums UNIX Desktop Questions & Answers Using grep to remove cells instead of lines Post 302567731 by Ygor on Monday 24th of October 2011 09:35:19 PM
Old 10-24-2011
Duplicate.
This User Gave Thanks to Ygor For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep for a particular pattern and remove few lines above top and bottom of the patter

grep for a particular pattern and remove 5 lines above the pattern and 6 lines below the pattern root@server1 # cat filename Shell Programming and Scripting test1 Shell Programminsada asda dasd asd Shell Programming and Scripting Post New Thread Shell Programming and S sadsa ... (17 Replies)
Discussion started by: fed.linuxgossip
17 Replies

2. Shell Programming and Scripting

grep/sed to remove lines in file

Hi, I have a file with values, file1: BELL-1180-1180-81|577:1017| BELL-1180-1180-81|jm10i-auto-stub1/577:102| BELL-1180-1180-81|jm10i-auto-stub1/577:101| BELL-1180-1180-81|jm10i-auto-stub1/577:1700| BELL-1180-1180-81|jm10i-auto-stub1/577:1699| I need to remove the lines which has... (9 Replies)
Discussion started by: giri_luck
9 Replies

3. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

4. UNIX for Dummies Questions & Answers

Grep command to remove blank lines

The following grep command grep -v "^$" filename > newfilename does not populate the new file with any data. I see it search the entire input file but the output file never gets filled. Is this not the correct command for what Im looking to do? (2 Replies)
Discussion started by: aispg8
2 Replies

5. UNIX for Dummies Questions & Answers

Using grep to remove cells instead of whole lines

I would like to use grep to remove certain strings from a text file but I can't use the grep -v option because it removes the whole line that includes the string whereas I just want to remove the string. How do I go about doing that? My input file: Magmas CEU rs12542019 CPNE1 RBM12 CEU... (2 Replies)
Discussion started by: evelibertine
2 Replies

6. UNIX for Dummies Questions & Answers

How to grep cells that contain a specific string?

How do you grep cells that contain a specific string. I tried grep but it greps the whole line and not just the cells. Thanks! (4 Replies)
Discussion started by: evelibertine
4 Replies

7. UNIX for Dummies Questions & Answers

Want to remove all lines but not latest 50 lines from a file

Hi, I have a huge file which has Lacs of lines. File system got full. I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with. (28 Replies)
Discussion started by: prashant2507198
28 Replies

8. Shell Programming and Scripting

Two files, remove lines from second based on lines in first

I have two files, a keepout.txt and a database.csv. They're unsorted, but could be sorted. keepout: user1 buser3 anuser19 notheruser27 database: user1,2343,"information about",field,blah,34 user2,4231,"mo info",etc,stuff,43 notheruser27,4344,"hiya",thing,more thing,423... (4 Replies)
Discussion started by: esoffron
4 Replies

9. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. UNIX for Beginners Questions & Answers

Remove duplicates in a dataframe (table) keeping all the different cells of just one of the columns

Hello all, I need to filter a dataframe composed of several columns of data to remove the duplicates according to one of the columns. I did it with pandas. In the main time, I need that the last column that contains all different data ( not redundant) is conserved in the output like this: A ... (5 Replies)
Discussion started by: pedro88
5 Replies
The talloc string functions.(3) 				      talloc					   The talloc string functions.(3)

NAME
The talloc string functions. - talloc string allocation and manipulation functions. Modules The talloc debugging support functions To aid memory debugging, talloc contains routines to inspect the currently allocated memory hierarchy. Functions char * talloc_strdup (const void *t, const char *p) Duplicate a string into a talloc chunk. char * talloc_strdup_append (char *s, const char *a) Append a string to given string. char * talloc_strdup_append_buffer (char *s, const char *a) Append a string to a given buffer. char * talloc_strndup (const void *t, const char *p, size_t n) Duplicate a length-limited string into a talloc chunk. char * talloc_strndup_append (char *s, const char *a, size_t n) Append at most n characters of a string to given string. char * talloc_strndup_append_buffer (char *s, const char *a, size_t n) Append at most n characters of a string to given buffer. char * talloc_vasprintf (const void *t, const char *fmt, va_list ap) Format a string given a va_list. char * talloc_vasprintf_append (char *s, const char *fmt, va_list ap) Format a string given a va_list and append it to the given destination string. char * talloc_vasprintf_append_buffer (char *s, const char *fmt, va_list ap) Format a string given a va_list and append it to the given destination buffer. char * talloc_asprintf (const void *t, const char *fmt,...) Format a string. char * talloc_asprintf_append (char *s, const char *fmt,...) Append a formatted string to another string. char * talloc_asprintf_append_buffer (char *s, const char *fmt,...) Append a formatted string to another string. Detailed Description talloc string allocation and manipulation functions. Function Documentation char* talloc_asprintf (const void *t, const char *fmt, ...) Format a string. This function is the talloc equivalent of the C library function asprintf(3). This functions sets the name of the new pointer to the new string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * Parameters: t The talloc context to hang the result off. fmt The format string. ... The parameters used to fill fmt. Returns: The formatted string, NULL on error. char* talloc_asprintf_append (char *s, const char *fmt, ...) Append a formatted string to another string. This function appends the given formatted string to the given string. Use this variant when the string in the current talloc buffer may have been truncated in length. This functions sets the name of the new pointer to the new string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * If s == NULL then new context is created. Parameters: s The string to append to. fmt The format string. ... The parameters used to fill fmt. Returns: The formatted string, NULL on error. char* talloc_asprintf_append_buffer (char *s, const char *fmt, ...) Append a formatted string to another string. This is a more efficient version of talloc_asprintf_append(). It determines the length of the destination string by the size of the talloc context. Use this very carefully as it produces a different result than talloc_asprintf_append() when a zero character is in the middle of the destination string. * char *str_a = talloc_strdup(NULL, "hello world"); * char *str_b = talloc_strdup(NULL, "hello world"); * str_a[5] = str_b[5] = ' ' * * char *app = talloc_asprintf_append(str_a, "%s", ", hello"); * char *buf = talloc_strdup_append_buffer(str_b, "%s", ", hello"); * * printf("%s0, app); // hello, hello (app = "hello, hello") * printf("%s0, buf); // hello (buf = "hello world, hello") * If s == NULL then new context is created. Parameters: s The string to append to fmt The format string. ... The parameters used to fill fmt. Returns: The formatted string, NULL on error. See Also: talloc_asprintf() talloc_asprintf_append() char* talloc_strdup (const void *t, const char *p) Duplicate a string into a talloc chunk. This function is equivalent to: * ptr = talloc_size(ctx, strlen(p)+1); * if (ptr) memcpy(ptr, p, strlen(p)+1); * This functions sets the name of the new pointer to the passed string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * Parameters: t The talloc context to hang the result off. p The string you want to duplicate. Returns: The duplicated string, NULL on error. char* talloc_strdup_append (char *s, const char *a) Append a string to given string. The destination string is reallocated to take strlen(s) + strlen(a) + 1 characters. This functions sets the name of the new pointer to the new string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * If s == NULL then new context is created. Parameters: s The destination to append to. a The string you want to append. Returns: The concatenated strings, NULL on error. See Also: talloc_strdup() talloc_strdup_append_buffer() char* talloc_strdup_append_buffer (char *s, const char *a) Append a string to a given buffer. This is a more efficient version of talloc_strdup_append(). It determines the length of the destination string by the size of the talloc context. Use this very carefully as it produces a different result than talloc_strdup_append() when a zero character is in the middle of the destination string. * char *str_a = talloc_strdup(NULL, "hello world"); * char *str_b = talloc_strdup(NULL, "hello world"); * str_a[5] = str_b[5] = ' ' * * char *app = talloc_strdup_append(str_a, ", hello"); * char *buf = talloc_strdup_append_buffer(str_b, ", hello"); * * printf("%s0, app); // hello, hello (app = "hello, hello") * printf("%s0, buf); // hello (buf = "hello world, hello") * If s == NULL then new context is created. Parameters: s The destination buffer to append to. a The string you want to append. Returns: The concatenated strings, NULL on error. See Also: talloc_strdup() talloc_strdup_append() talloc_array_length() char* talloc_strndup (const void *t, const char *p, size_tn) Duplicate a length-limited string into a talloc chunk. This function is the talloc equivalent of the C library function strndup(3). This functions sets the name of the new pointer to the passed string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * Parameters: t The talloc context to hang the result off. p The string you want to duplicate. n The maximum string length to duplicate. Returns: The duplicated string, NULL on error. char* talloc_strndup_append (char *s, const char *a, size_tn) Append at most n characters of a string to given string. The destination string is reallocated to take strlen(s) + strnlen(a, n) + 1 characters. This functions sets the name of the new pointer to the new string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * If s == NULL then new context is created. Parameters: s The destination string to append to. a The source string you want to append. n The number of characters you want to append from the string. Returns: The concatenated strings, NULL on error. See Also: talloc_strndup() talloc_strndup_append_buffer() char* talloc_strndup_append_buffer (char *s, const char *a, size_tn) Append at most n characters of a string to given buffer. This is a more efficient version of talloc_strndup_append(). It determines the length of the destination string by the size of the talloc context. Use this very carefully as it produces a different result than talloc_strndup_append() when a zero character is in the middle of the destination string. * char *str_a = talloc_strdup(NULL, "hello world"); * char *str_b = talloc_strdup(NULL, "hello world"); * str_a[5] = str_b[5] = ' ' * * char *app = talloc_strndup_append(str_a, ", hello", 7); * char *buf = talloc_strndup_append_buffer(str_b, ", hello", 7); * * printf("%s0, app); // hello, hello (app = "hello, hello") * printf("%s0, buf); // hello (buf = "hello world, hello") * If s == NULL then new context is created. Parameters: s The destination buffer to append to. a The source string you want to append. n The number of characters you want to append from the string. Returns: The concatenated strings, NULL on error. See Also: talloc_strndup() talloc_strndup_append() talloc_array_length() char* talloc_vasprintf (const void *t, const char *fmt, va_listap) Format a string given a va_list. This function is the talloc equivalent of the C library function vasprintf(3). This functions sets the name of the new pointer to the new string. This is equivalent to: * talloc_set_name_const(ptr, ptr) * Parameters: t The talloc context to hang the result off. fmt The format string. ap The parameters used to fill fmt. Returns: The formatted string, NULL on error. char* talloc_vasprintf_append (char *s, const char *fmt, va_listap) Format a string given a va_list and append it to the given destination string. Parameters: s The destination string to append to. fmt The format string. ap The parameters used to fill fmt. Returns: The formatted string, NULL on error. See Also: talloc_vasprintf() Format a string given a va_list and append it to the given destination string. Good for gradually accumulating output into a string buffer. Appends at the end of the string. char* talloc_vasprintf_append_buffer (char *s, const char *fmt, va_listap) Format a string given a va_list and append it to the given destination buffer. Parameters: s The destination buffer to append to. fmt The format string. ap The parameters used to fill fmt. Returns: The formatted string, NULL on error. See Also: talloc_vasprintf() Format a string given a va_list and append it to the given destination buffer. Always appends at the end of the talloc'ed buffer, not the end of the string. Author Generated automatically by Doxygen for talloc from the source code. Version 2.0 Tue Jun 17 2014 The talloc string functions.(3)
All times are GMT -4. The time now is 04:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy