Sponsored Content
Top Forums Shell Programming and Scripting awk to adjust coordinates in field based on sequential numbers in another field Post 302990647 by cmccabe on Monday 30th of January 2017 07:39:30 AM
Old 01-30-2017
Thank you very much for your help and for catching the output correction, this is why the computer does the math Smilie.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find top N values for field X based on field Y's value

I want to find the top N entries for a certain field based on the values of another field. For example if N=3, we want the 3 best values for each entry: Entry1 ||| 100 Entry1 ||| 95 Entry1 ||| 30 Entry1 ||| 80 Entry1 ||| 50 Entry2 ||| 40 Entry2 ||| 20 Entry2 ||| 10 Entry2 ||| 50... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

2. UNIX for Dummies Questions & Answers

awk - Summing a field based on another field

So, I need to do some summing. I have an Apache log file with the following as a typical line: 127.0.0.1 - frank "GET /apache_pb.gif HTTP/1.0" 200 2326 Now, what I'd like to do is a per-minute sum. So, I can have awk tell me the individual minutes, preserving the dates(since this is a... (7 Replies)
Discussion started by: treesloth
7 Replies

3. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

4. Shell Programming and Scripting

AWK: Pattern match between 2 files, then compare a field in file1 as > or < field in file2

First, thanks for the help in previous posts... couldn't have gotten where I am now without it! So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following: If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies

5. UNIX for Dummies Questions & Answers

[Solved] awk solution to add sequential numbers based on a word

Hi experts, I've been struggling to format a large genetic dataset. It's complicated to explain so I'll simply post example input/output $cat input.txt ID GENE pos start end blah1 coolgene 1 3 5 blah2 coolgene 1 4 6 blah3 coolgene 1 4 ... (4 Replies)
Discussion started by: torchij
4 Replies

6. Shell Programming and Scripting

awk to combine matches and use a field to adjust coordinates in other fields

Trying to output a result that uses the data from file to combine and subtract specific lines. If $4 matches in each line then the last $6 value is added to $2 and that becomes the new$3. Each matching line in combined into one with $1 then the original $2 then the new$3 then $5. For the cases... (4 Replies)
Discussion started by: cmccabe
4 Replies

7. Shell Programming and Scripting

awk to update value in field based on another field

In the tab-delimeted input file below I am trying to use awk to update the value in $2 if TYPE=ins in bold, by adding the value of HRUN= in italics. In the below since in line 1 TYPE=ins the 117282541 value in $2 has 6 added because that is the value of HRUN=. Hopefully the awk is a start but I... (2 Replies)
Discussion started by: cmccabe
2 Replies

8. Shell Programming and Scripting

awk to adjust text and count based on value in field

The below awk executes as is and produces the current output. It isvery close but what Ican not seem to do is add the -exon..., the ... portion comes from $1 and the _exon is static and will never change. If there is + sign in $4 then the ... is in acending order or sequential. If there is a - in... (2 Replies)
Discussion started by: cmccabe
2 Replies

9. Shell Programming and Scripting

Perl to adjust coordinates based on repeat string

In the file below I am trying to count the given repeats of A,T,C,G in each string of letters. Each sequence is below the > and it is possible for a string of repeats to wrap from the line above. For example, in the first line the last letter is a T and the next lines has 3 more. I think the below... (10 Replies)
Discussion started by: cmccabe
10 Replies

10. UNIX for Beginners Questions & Answers

Problem with getting awk to multiply a field by a value set based on condition of another field

Hi, So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
mcxquery(1)						    BSD General Commands Manual 					       mcxquery(1)

NAME
mcxquery -- Managed Client (MCX) compositor query tool SYNOPSIS
mcxquery [options] [-user recordName] [-group recordName] [-computer spec] options: -o path Writes output to a file at the specified path. -format space | tab | xml Specifies the format of the output. -computerOnly Ignore values for -user and -group. -useCache Return the cached computer settings in the local node if they are available. -raw Dumps Directory Service data for records contributing to managed preferences. -forApple Convenience for specifying options when sending bug reports to Apple. Currently enables "-raw" and "-for- mat xml". See usage example below. DESCRIPTION
mcxquery is a utility to determine the effective managed preferences for a user logging in to a workgroup from a specific computer. -user Specify the short name of the user record to read managed preferences from. If this parameter is omitted, or a value of "=" speci- fied, the short name of the currently logged in console user will be used. -group Specify the short name of the group record to read managed preferences from. A value of "=" may be specified to mean the name of the workgroup (if any) chosen for the current login session. -computer Specify the computer record to read managed preferences from. The computer can be specified using either an Ethernet MAC address (e.g. "11:22:33:44:55:66"), a Hardware UUID (e.g. "00112233-4455-6677-8899-AABBCCDDEEFF") or the short name of the computer record itself (e.g. "lab1_12"). If this parameter is omitted, or a value of "=" specified, the record for the current computer will be used. EXAMPLES
mcxquery -user jane -group science -computer lab1_12 Displays the managed preferences that would be in effect if user "jane" logged in using workgroup "science" from the computer speci- fied in the "lab1_12" computer record. mcxquery -user jane -group science -computer 11:22:33:44:55:66 Displays the managed preferences that would be in effect if user "jane" logged in using workgroup "science" from a computer with an Ethernet MAC address of 11:22:33:44:55:66. mcxquery -user = -group = -computer guest Displays the managed preferences that would be in effect if the current user logged in using the current workgroup into a computer not specified by any computer record (i.e. a "guest" computer). mcxquery -user jane -group math Displays the managed preferences that would be in effect if the user "jane" logged into the "math" workgroup on the current com- puter. mcxquery -o /tmp/report.txt -format xml -user jane Writes the managed preferences that would be in effect if user "jane" logged into the current computer without a workgroup. The report is written in XML format to /tmp/report.txt. mcxquery -computerOnly -computer lab1_12 Displays the managed preferences for the computer specified in the "lab1_12" computer record only. Useful for determining managed settings when computer is at login window. mcxquery -computerOnly -computer 00112233-4455-6677-8899-AABBCCDDEEFF Displays the managed preferences for the computer with the Hardware UUID "00112233-4455-6677-8899-AABBCCDDEEFF". Supported on Mac OS X 10.6 and later. mcxquery -forApple -o results.plist Creates a plist, suitable for submitting along with bug reports to Apple, containing the managed preferences for the current user on the current computer. Also includes relevant records from Directory Services. Supported on Mac OS X 10.7 and later. SEE ALSO
dscl(1) MacOSX November 30, 2010 MacOSX
All times are GMT -4. The time now is 10:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy