Sponsored Content
Full Discussion: find the field number
Top Forums Shell Programming and Scripting find the field number Post 302470510 by kykyboss023 on Wednesday 10th of November 2010 09:54:12 AM
Old 11-10-2010
hi

this commande doesn't work, and how do you check that the A[$1]=IDENTIFIER


Code:
 
awk -F, '{for(i=1;i<=NF;i++)A[$i]=i;print "The field "v" is on position "A[v];delete A}' FastZero_header.csv
 Syntax Error The source line is 1.
 The error context is
                {for(i=1;i<=NF;i++)A[$i]=i;print "The field "v" is on position "A[v];delete >>>  A} <<<
 awk: 0602-502 The statement cannot be correctly parsed. The source line is 1.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to search a number in a certain field

Hello, I have a file that looks like this: num11 num12 num13 word1 num21 num22 num23 word2 num31 num32 num33 word3 . . . I would like to search for the lines that contain a given number, but I need to narrow the search only to the first field, that means that the number has to... (4 Replies)
Discussion started by: shira
4 Replies

2. 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

3. Shell Programming and Scripting

Sorting on two fields time field and number field

Hi, I have a file that has data in it that says 00:01:48.233 1212 00:01:56.233 345 00:09:01.221 5678 00:12:23.321 93444 The file has more line than this but i just wanted to put in a snippet to ask how I would get the highest number with time stamp into another file. So from the above... (2 Replies)
Discussion started by: pat4519
2 Replies

4. Shell Programming and Scripting

Count number of occurences of a character in a field defined by the character in another field

Hello, I have a text file with n lines in the following format (9 column fields): Example: contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies

5. Shell Programming and Scripting

Adding total of first field for each number in the second field

Dears, I need a script or command which can find the unique number from the second filed and against that number it adds the total of first field . 17215630 , 0 907043 ,1 201050 ,10 394149 ,4 1964 ,9 17215630, 0 907043 ,1 201050, 10 394149 ,4 1964 ,9 1234234, 55 23 ,100 33 ,67 ... (2 Replies)
Discussion started by: shary
2 Replies

6. Shell Programming and Scripting

Help with number field manipulation

I have a comma separated file containing numbers, I would like to read the file and divide each number by 1024 and create an output file. Input file : 50312.00,3434.05, ,3433.34,124344.00,434343.00, , , Output file: 49.13,3.35,3.35,0,12.05,424.16,0,0 Please click this link: How to... (2 Replies)
Discussion started by: inditopgun
2 Replies

7. Shell Programming and Scripting

Get the changed field number

HI, I have two files and contains many Fields or columns with | (pipe) delimitor, wanted to compare both the files and get only unmatched perticular fields number. ex: first.txt 111 |abc| 230| hbc | bb2 | cs second.txt 111 |abc |230 |abn | bb2 | fp Here the different data in two... (2 Replies)
Discussion started by: prawinmca
2 Replies

8. Shell Programming and Scripting

Changed Field Number

HI, I have two files and contains many Fields or columns with | (pipe) delimitor, wanted to compare both the files and get only unmatched perticular fields number. ex: first.txt 1 | 2 | 3 111 |abc| 230 hbc | bb2 | cs second.txt 1 | 2 | 3 111 |abc |230 abn | bb2 | fp Here the... (7 Replies)
Discussion started by: prawinmca
7 Replies

9. Shell Programming and Scripting

awk to find number in a field then print the line and the number

Hi I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field. The source file is pipe delimited and looks something like 1|net|ABC Letr1|1530||| 1|net|EXP_1040 ABC|1121||| 1|net|EXP_TG1224|1122||| 1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies

10. Shell Programming and Scripting

Different field number in the file

Hello Friends I have a data file which is comma seperate (,) where i am expecting 2 column but there are number of time when file comes with data having more than 2 column. I want to check which line has more columns 20141115,15/11/2014 20141129,29/11/2014 20141003,03/10/2014... (4 Replies)
Discussion started by: guddu_12
4 Replies
form_field_opts(3X)													       form_field_opts(3X)

NAME
form_field_opts - set and get field options SYNOPSIS
#include <form.h> int set_field_opts(FIELD *field, OPTIONS opts); int field_opts_on(FIELD *field, OPTIONS opts); int field_opts_off(FIELD *field, OPTIONS opts); OPTIONS field_opts(const FIELD *field); DESCRIPTION
The function set_field_opts sets all the given field's option bits (field option bits may be logically-OR'ed together). The function field_opts_on turns on the given option bits, and leaves others alone. The function field_opts_off turns off the given option bits, and leaves others alone. The function field_opts returns the field's current option bits. The following options are defined (all are on by default): O_VISIBLE The field is displayed. If this option is off, display of the field is suppressed, O_ACTIVE The field is visited during processing. If this option is off, the field will not be reachable by navigation keys. Please notice that an invisible field appears to be inactive also. O_PUBLIC The field contents are displayed as data is entered. O_EDIT The field can be edited. O_WRAP Words that don't fit on a line are wrapped to the next line. Words are blank-separated. O_BLANK The field is cleared whenever a character is entered at the first position. O_AUTOSKIP Skip to the next field when this one fills O_NULLOK Allow a blank field. O_STATIC Field buffers are fixed to field's original size. O_PASSOK Validate field only if modified by user. RETURN VALUE
Except for field_opts, each routine returns one of the following: E_OK The routine succeeded. E_SYSTEM_ERROR System error occurred (see errno). E_CURRENT The field is the current field. SEE ALSO
curses(3X), form(3X). NOTES The header file <form.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. form_field_opts(3X)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy