9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to use awk to identify and print out records in fields that are empty along with which line they are in. I hope the awk below is close, it runs but nothing results. Thank you :).
awk
awk -F'\t' 'FNR==NR ~ /^*$/ { print "NR is empty" }' file
file
123 GOOD ID 45... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. HP-UX
Dear Concern,
Please go through the article
https://www.unix.com/hp-ux/134072-typing-sign-creates-new-line.html
As per the article, we need to initiate below commands. But after creating new session, we face same problem. Please advise.
stty intr "^c"
stty kill "^u"
Please find below... (6 Replies)
Discussion started by: makauser
6 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I've got a file that has 12 fields. I've merged 2 files and there will be some duplicates in the following:
FILE:
1. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, 100
2. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, (EMPTY)
3. CDC, 54321, TEST3,... (4 Replies)
Discussion started by: tugar
4 Replies
4. Shell Programming and Scripting
How to write in awk to remove lines starting with "#" and then process the file:
This is not working:
cat file|awk '{if ($0 ~ /^#/) $0="";print NF>0}'
When I just give cat file|awk '{if ($0 ~ /^#/) $0="";print }'
it prints the blank lines . I don't wnat the blank lines along with the... (15 Replies)
Discussion started by: rveri
15 Replies
5. UNIX for Dummies Questions & Answers
I'm using a script that does some modifications to data on disc and updates the database. The script (perl) uses STDOUT so the results are printed to the screen. I don't have permissions to modify the script. I want to capture the results in a file so I can see if errors occurred and also keep... (3 Replies)
Discussion started by: surib
3 Replies
6. Shell Programming and Scripting
I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies
7. Shell Programming and Scripting
I have a script that runs ditto for me, and occasionally (if I exit the script while ditto is running in the background) it will leave an empty file named 0 in the script's directory. The next time I run the script, it generates incorrect data because of this file. I know I can easily insert a... (1 Reply)
Discussion started by: reid
1 Replies
8. Shell Programming and Scripting
hello
I have a file with lines of info separated with "|"
I want to amend the second field of the last line, using AWK
my problem is with geting awk to return the last line
this is what I am using
awk 'END{ print $0 }' myFile
but I get an empty result
I tried the... (13 Replies)
Discussion started by: TasosARISFC
13 Replies
9. Shell Programming and Scripting
I have a script with this statement:
/usr/xpg4/bin/awk -F"" 'NR==FNR{s=$2;next}{printf "%s\"%s\"\n", $0, s}' LOOKUP.TXT finallistnew.txt >test.txt
I want to include logic or an additional step that says if there is no data in field 3, move the whole line out of test.txt into an additional... (9 Replies)
Discussion started by: scriptr2be
9 Replies