Sponsored Content
Full Discussion: how to get specific line
Top Forums UNIX for Dummies Questions & Answers how to get specific line Post 302570101 by teefa on Wednesday 2nd of November 2011 11:33:26 AM
Old 11-02-2011
Corona688

thanks alot Smilie the null here if london is not found under location

i have 50 location and 35 london
the output must be 50 record for london not found prints null in its place to determine ( for example there is no null in the location 29 ) got it Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting Characters at specific position in a line if the line is certain length

I've got a file that would have lines similar to: 12345678 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 23456781 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 34567812 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 45678123 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 xx.00... (10 Replies)
Discussion started by: Cailet
10 Replies

2. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

3. Shell Programming and Scripting

Copying x words from end of line to specific location in same line

Hello all i know it is pretty hard one but you will manage it all after noticing and calculating i find a rhythm for the file i want to edit to copy the last 12 characters in line but the problem is to add after first 25 characters in same line in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies

4. Shell Programming and Scripting

perform some operation on a specific coulmn starting from a specific line

I have a txt file having rows and coulmns, i want to perform some operation on a specific coulmn starting from a specific line. eg: 50.000000 1 1 1 1000.00000 1000.00000 50000.000 19 19 3.69797533E-07 871.66394 ... (3 Replies)
Discussion started by: shashi792
3 Replies

5. Shell Programming and Scripting

Counting rows line by line from a specific column using Awk

Dear UNIX community, I would like to to count characters from a specific row and have them displayed line-by-line. I have a file called testAwk2.csv which contain the following data: rabbit penguin goat giraffe emu ostrich I would like to count in the middle row individually... (4 Replies)
Discussion started by: vnayak
4 Replies

6. Shell Programming and Scripting

Using awk to read a specific line and a specific field on that line.

Say the input was as follows: Brat 20 x 1000 32rf Pour 15 p 1621 05pr Dart 10 z 1111 22xx My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour" I currently have this line but it is... (6 Replies)
Discussion started by: Bungkai
6 Replies

7. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

8. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

9. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

10. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
wmemcpy(3)						     Library Functions Manual							wmemcpy(3)

NAME
wmemcpy, wmemchr, wmemcmp, wmemmove, wmemset - Perform memory operations on wide-character arrays LIBRARY
Standard C Library (libc) SYNOPSIS
#include <wchar.h> wchar_t *wmemcpy( wchar_t *wstr1, const wchar_t *wstrs2, size_t n); wchar_t *wmemchr( const wchar_t *wstr, wchar_t wc, size_t n); int wmemcmp( const wchar_t *wstr1, const wchar_t *wstr2, size_t n); wchar_t *wmemmove( wchar_t *wstr1, const wchar_t *wstr2, size_t n); wchar_t *wmemset( wchar_t *wstr, wchar_t wc, size_t n); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: wmemcpy(), wmemchr(), wmemcmp(), wmemmove(), wmemset(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the location of a wide-character string. Points to the location of a destination wide-character string. Points to the location of a source wide-character string. Specifies a wide character for which to search (except for the wmemset() case, in which wc is the tar- get of the copy). Specifies the number of wide characters to search. DESCRIPTION
The wmemcpy(), wmemchr(), wmemcmp(), wmemset(), and wmemmove() functions operate on wide-character strings in memory areas. A memory area is a group of contiguous wide characters bound by a count and not terminated by a null wide character. These memory functions do not check for overflow of the receiving memory area. They are also not affected by locale; therefore, they do not give special treatment to a null wide character or wide-character values that do not correspond to valid multibyte characters. Unless stated otherwise, these functions order two wide characters the same way as two integers of the integral type wchar_t. All of these memory functions are declared in the wchar.h header file. The wmemcpy() function copies n wide characters from the string pointed to by the wstr2 parameter into the location pointed to by the wstr1 parameter. When copying overlapping strings, the behavior of this function is unreliable. The wmemchr() function sequentially searches the wide-character string at the location pointed to by the wstr parameter until one of the following occurs: The wide character specified by the wc parameter has been found. The number of wide characters specified by the n param- eter have been searched at location wstr. If wc is found, the wmemchr() function returns a pointer to that wide character in the string pointed to by wstr. If wc is not found after searching n wide characters, the function returns a null pointer. The wmemcmp() function compares the first n wide characters of the string pointed to by the wstr1 parameter with the first n wide charac- ters of the string pointed to by the wstr2 parameter. This function returns one of the following values: Less than zero if the value of the object in wstr1 is less than the value of the object in wstr2 Zero if the value of object in wstr1 is equal to the value of the object in wstr2 Greater than zero if the value of the object in wstr1 is greater than the value of the object in wstr2 The wmemset() function first copies the value of the wide character specified by the wc parameter into each of the first n locations of the string pointed to by the wstr parameter and then returns the value of wstr. The wmemmove() function copies n wide characters from the string at the location pointed to by the wstr2 parameter to the string at the location pointed to by the wstr1 parameter. Copying takes place as though the n wide characters from string wstr2 are first copied into a temporary array having n wide characters that does not overlap either of the strings pointed to by wstr1 or wstr2. Then, n number of wide characters from the temporary array are copied to the string pointed to by wstr1. Consequently, this operation is nondestructive and pro- ceeds from left to right. The wmemmove() function returns the value of wstr1. When the value of n is zero, all these functions either return zero or copy zero wide characters, depending on whether the purpose of the function is to compare or copy wide characters. RETURN VALUES
The wmemchr() function returns a pointer to the location of wc in wstr or a null pointer if wc is not found in the first n wide characters of wstr. The wmemcmp() function returns a value greater than, equal to, or less than 0 (zero), according to whether the first n wide characters of the string pointed to by the wstr1 parameter have a value greater than, equal to, or less than the first n wide characters in the string pointed to by the wstr2 parameter. The wmemcpy() and wmemmove() functions return the wide-character string pointed to by the wstr1 parameter. The wmemset() function returns the wide-character string pointed to by the wstr parameter. RELATED INFORMATION
Functions: bcopy(3), memccpy(3), string(3), swab(3), wcscat(3), wcsspn(3), wcsstr(3), wcswcs(3) delim off wmemcpy(3)
All times are GMT -4. The time now is 10:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy