01-30-2013
Find for line with not null values at nth place in pipe delimited file
Hi,
I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please.
thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
How can I check for a field in a pipe-delimited file having a NULL value in Unix using a grep command or any other command.
Please reply (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
2. Shell Programming and Scripting
Hi,
I have a pipe delimited txt file which contains 17 fields per line/row.
16th field contains email id. I want to count the number of lines/rows that contains null in the 16th field.
Plz find attached example data file.
I'm looking for a command line/script which achieves this.
... (5 Replies)
Discussion started by: Sriranga
5 Replies
3. Shell Programming and Scripting
For example i'm having the below contents in a file:
expr is great when you want to split a string into just two parts. The .* also makes expr good for skipping a variable number of words when you don't know how many words a string will have. But expr is lousy for getting, say, the fourth word... (2 Replies)
Discussion started by: bangarukannan
2 Replies
4. Shell Programming and Scripting
this is Korn shell unix.
The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
Discussion started by: vasan2815
4 Replies
5. UNIX for Dummies Questions & Answers
Hi friends,
I have a file where I should search for a string and get the rest of the line but without the delimiter using awk.
for example I have the series of string in a file:
input_string.txt
bbb
ccc
aaa
and the mapping file looks like this.
mapping.txt
aaa|12
bbb|23
ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies
6. Shell Programming and Scripting
I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column.
Here is the script that works for the maximum value.
awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Discussion started by: ncwxpanther
3 Replies
7. Shell Programming and Scripting
Hi All,
I have a large dat file where each lines are pipe delimited values. I need to parse the file depending on the request. For example: sometimes I have told to remove all the values in the 7th column (this case remove values '3333' only from the first line and '3543' from the second line)... (4 Replies)
Discussion started by: express14
4 Replies
8. UNIX for Dummies Questions & Answers
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have a requirement where I have to check whether the mandatory columns in a pipe delimited file is null and print error message.
For eg, I have to check if the 3rd,5th,6th,7th and 8th column are null and print the message "<column name> is null".
The data file will have aroung 100,000... (6 Replies)
Discussion started by: reshma15193
6 Replies
10. Shell Programming and Scripting
I have a file as below
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
2345|FirstName2|MiddleName3|LastName4|
Add1 || ADD2|
234|000000000
OUTPUT :
... (1 Reply)
Discussion started by: styris
1 Replies
wc(1) General Commands Manual wc(1)
NAME
wc - count words, lines, and bytes or characters in a file
SYNOPSIS
[file]...
DESCRIPTION
The command counts lines, words, and bytes or characters in the named files, or in the standard input if no file names are specified. It
also keeps a total count for all named files.
A word is a string of characters delimited by spaces, tabs, or newlines.
Options
recognizes the following options:
Report the number of bytes in each input file.
Report the number of newline characters in each input file.
Report the number of characters in each input file.
Report the number of words in each input file.
The and options are mutually exclusive. Otherwise, the and or options can be used in any combination to specify that a subset of lines,
words, and bytes or characters are to be reported.
When any option is specified, reports only the information requested. If no option is specified, the default output is
When a file is specified on the command line, its name is printed along with the counts.
Standard Output
By default, the standard output contains an entry for each input file in the form:
newlines words bytes file
If the option is specified, the number of characters replaces the bytes field in this format.
If any option is specified, the fields for the unspecified options are omitted.
If no file operand is specified, neither the file name nor the preceding blank character is written.
If more than one file operand is specified, an additional line is written at the end of the output, of the same format as the other lines,
except that the word (in the POSIX locale) is written instead of a file name and the total of each column is written as appropriate.
Under UNIX Standard environment, a word is a string of characters delimited by spaces, tabs, newline, carriage-return, vertical tab, or
form-feed.
RETURN VALUE
exits with one of the following values:
Successful completion.
An error occurred.
EXTERNAL INFLUENCES
For information about the UNIX Standard environment, see standards(5).
Environment Variables
determines the range of graphics and space characters, and the interpretation of text as single- and/or multibyte characters.
determines the language in which messages are displayed.
If or is not specified in the environment or is null, they default to the value of
If is not specified or is null, it defaults to (see lang(5)).
If any internationalization variable contains an invalid setting, they all default to See environ(5).
International Code Set Support
Single- and multibyte character code sets are supported. with a newline character, the count will be off by one.
WARNINGS
The command counts the number of newlines to determine the line count. If a text file has a final line that is not terminated with a new-
line character, the count will be off by one.
EXAMPLES
Print the number of words and characters in
The following is printed when the above command is executed:
where words is the number of words and chars is the number of characters in
SEE ALSO
standards(5).
STANDARDS CONFORMANCE
wc(1)