10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the following a.txt file
A|1|2|3|4|5|
A||2|3|0||
A|1|6||8|10|
A|9|2|3|4|1|
A|0|9|3|4|5|
A||2|3|4|5|
A|0|av|.9|4|9|
I use the following command to count null values for 2nd field
awk -F"|" '!$2 { N++; next } END {print N}' a.txt
It should give the result 2, but it is giving... (2 Replies)
Discussion started by: RJG
2 Replies
2. Shell Programming and Scripting
The below code works great, kindly provided by @Don Cragun, the lines in bold print the current output. Since some of the fields printed can be blank some of the fields are shifted. I can not seem too add . to the blank fields like in the desired output. Basically, if there is nothing in the field... (10 Replies)
Discussion started by: cmccabe
10 Replies
3. Shell Programming and Scripting
Hi Folks,
We have a file that has null values but there are no delimiters. So all columns are considered as a single column.
Ex:
abc def 123
abcdef1234567
hijklmn7896545
Now from "a" till "3" all are considered as a single column from the first row.
Our requirement is like, we... (2 Replies)
Discussion started by: jayadanabalan
2 Replies
4. Shell Programming and Scripting
Hi,
I've a pipe delimited file and wanted to replace the 3rd field to 099990 where the values are null. How can I achieve it using awk or sed.
20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S
20130516|00000061|02210|111554|03710|2|205069|SM APPL $80-100 RTL|S... (12 Replies)
Discussion started by: rudoraj
12 Replies
5. Shell Programming and Scripting
Hi All ,
below is my shell program.
!/bin/sh
set -x
#----------------------------------------------------------------------------------------
# Program : weekly_remove_icd_file.sh
# Author :
# Date : 04/06/2013
# Purpose : Execute the script to... (3 Replies)
Discussion started by: krupasindhu18
3 Replies
6. Shell Programming and Scripting
Hi,
I've a pipe delimited file where I want to find out a number of lines where 1st 2nd and last field are null using awk/sed. Is it possible?
Thanks (5 Replies)
Discussion started by: rudoraj
5 Replies
7. Shell Programming and Scripting
I have a huge file with 20 fileds in each record and each field is seperated by "|". If i want to get all the reocrds that have 18th or for that matter any filed as null how can i do it? Please let me know (3 Replies)
Discussion started by: dsravan
3 Replies
8. Shell Programming and Scripting
Hi,
I have a file with 104 columns delimited by comma.
I have to replace fields 4,5 and 19 with null values and after replacing the columns in the file , the file should be still comma delimited. I am new to shell scripting, Experts please help me out.
Thank you (1 Reply)
Discussion started by: vukkusila
1 Replies
9. Shell Programming and Scripting
Hi All,
I have some csv files out of which i want to find records which have empty values in either the 14th or 16th fields.
The following is a sample.
$cut -d',' -f14,16 SPS* | head -5
VOIP_ORIG_INFO,VOIP_DEST_INFO
sip:445600709315@sip.com,sip:999@sip.com... (2 Replies)
Discussion started by: rahulrathod
2 Replies
10. Shell Programming and Scripting
Hi,
I have a log file which is constantly being written to by some process. I need to clear that log file on a daily basis.
The problem is that when I issue this command:
echo "" > logfile.log
the file gets filled with nulls thus increasing the size of the file.
Is there a way to... (2 Replies)
Discussion started by: kasie4life
2 Replies