10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
The below code runs and creates an output file with three sections. The first 2 sections are ok, but the third section doesn't seem to put a . in all the fields that are blank. I don't know if this is what causes the last two fields in the current output to shift to a newline, but I can not seem... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. Shell Programming and Scripting
Hi,
I have a csv file with given details
abc.txt
123,ra,point,,there
232,ba,points,home,pheer
I want to get those values and store them in different variables:
Code:
while read line
do
echo $line |awk -F"," '{print $1" "$2" "$3" "$4" "$5"}'|read dbt_acct val_dt crncy AMT... (11 Replies)
Discussion started by: rahulsk
11 Replies
3. Shell Programming and Scripting
Using awk I am trying to replace all blank or null values with a . in the tad delimited input. I hope the awk is close. Thank you :).
input
name test
sam 1
liz 2
al
1
awk
awk 'BEGIN{FS=OFS="\t"}{for(i=1;++i<NF;)$i=$i?$i:"."}1'input
awk 'BEGIN { FS =... (6 Replies)
Discussion started by: cmccabe
6 Replies
4. 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
5. Shell Programming and Scripting
I am using below code to validate the source file,code working fine but if any column contains null value then below code throwing error actually it should not.how to customize the below code to handle null null values also.
When I run the script with below source data getting “date error”, as... (2 Replies)
Discussion started by: srivalli
2 Replies
6. 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
7. 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
8. 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
9. Shell Programming and Scripting
Hi,
I have a pipe seperated file
I want to write a code to display count of lines that have 20th field not null.
nawk -F"|" '{if ($20!="") print NR,$20}' xyz..txt
This displays records with 20th field also null.
I would like output as: (4 Replies)
Discussion started by: pinnacle
4 Replies
10. 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