10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to remove using the sed/awk if the rows are starting with any numbers till "-" character. from the below sample output and expected results.
Sample looks like below :
704 - sample - test
5500 - line2
449 - line3
44 - line4
Line5
Expected -
sample - test
line2
line3
line4... (5 Replies)
Discussion started by: kiran_hp
5 Replies
2. Shell Programming and Scripting
Hi
I have a file as below
<field1> <field2> <field3> ... <field_num1> <field_num2>
Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields.
I tried this and it doesn't sort on the difference field .. Appreciate your help.
cat... (9 Replies)
Discussion started by: newstart
9 Replies
3. Shell Programming and Scripting
I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies
4. Shell Programming and Scripting
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies
5. Shell Programming and Scripting
I am trying to trim spaces for the fixed width file starting from location 129 and of length 20.
I am expecting only around 40 records that will have length greater than 9. But i am getting around 4000 records.
Please help me correct the following.
nawk '{if (a=length(gsub(/... (2 Replies)
Discussion started by: pinnacle
2 Replies
6. Shell Programming and Scripting
Please see the following code, between "status" and "OK" exists many spaces, I want to get status OK . how to ignore multi spaces? If tab exists in the spaces, how to ignore it ?
Is there other commands can replace cut?
$ echo 'drv status OK'| cut... (3 Replies)
Discussion started by: 915086731
3 Replies
7. Shell Programming and Scripting
Is there some easy way to trim empty fields but only in a given range?
for example say I have csv data that looks like this:
apple,,,Granysmith,,2.50,,TimmysGrocers
Pear,Bartlett,,,,,Park,
peach,,,,Peento,3.00,Garden,TimmysGrocers
is there a way of getting the single field with data... (4 Replies)
Discussion started by: cue
4 Replies
8. Shell Programming and Scripting
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies
9. Shell Programming and Scripting
Hi all,
I am using qwk to parse the logfile.
The code like
awk ' {
if($0 > " ")
{
MSISDN=substr($0,1,10)
HOUR=substr($0,11,6);
ID_SA_SOURCE=substr($0,17,18);
ID_SA_DEST=substr($0,35,18);
... (3 Replies)
Discussion started by: subin_bala
3 Replies
10. UNIX for Dummies Questions & Answers
Data begins as such;
Mar 16 03:27:05 afzpimdn01 named: denied update from .3983 for "nnn.nnn.in-addr.arpa" IN
Mar 16 03:27:37 afzpimdn01 named: denied update from .4844 for "nnn.nnn.in-addr.arpa" IN
Mar 16 03:27:56 afzpimdn01 named: denied update from .2650 for "nnn.nnn.in-addr.arpa" IN
... (4 Replies)
Discussion started by: altamaha
4 Replies