10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Input data as below (filetest.txt):
1|22 JAN Minimum Bal 20.00 | SAT
2|09 FEB Extract bal 168.00BR | REM
3|MIN BAL | LEX
Output should be:
( If there is Date & Month in 2nd field of Input file, It should be seperated else blank. If There is Decimal OR Decimal & Currency in last of the 2nd... (7 Replies)
Discussion started by: JSKOBS
7 Replies
2. Shell Programming and Scripting
I am trying to reformat the table by filling any missing rows. The final table will have consecutive IDs in the first column. My problem is the index of the associate array in the awk script.
infile:
S01 36407 53706 88540
S02 69343 87098 87316
S03 50133 59721 107923... (4 Replies)
Discussion started by: yifangt
4 Replies
3. Shell Programming and Scripting
When I search for the string
capId=...
using
awk '/capId=.../' file
I get successful results.
However when I feed the string as a variable, like this:
str="capId=..."
awk -v str="$str" 'index($0, str)' file
I get no results.
What can I do if I need to generate a string that contains... (1 Reply)
Discussion started by: locoroco
1 Replies
4. Shell Programming and Scripting
HI All,
I would like to pass a integer and get all values under this index the by using awk. Could anyone help?
Thanks :>
input:
1,2,3,4,5,6,7
1,2,3,48,5,6,7
1,2,3,4,5,6,7
e.g. i pass 4 to awk command
output:
4
48
4
Video tutorial on how to use code tags in The UNIX and Linux... (8 Replies)
Discussion started by: mimilaw
8 Replies
5. Shell Programming and Scripting
1 2 000060000
How do i return the point in the string where the 6 is?
i.e what I want on output is
1 2 5
something like awk '{print $1 $2 index($3,6) }'
but I can't get it to work
Thanks in advance (3 Replies)
Discussion started by: garethsays
3 Replies
6. Shell Programming and Scripting
Hi All,
I have a file (FileNames.txt) which contains the following data in it.
$ cat FileNames.txt
MYFILE17XXX208Sep191307.csv
MYFILE19XXX208Sep192124.csv
MYFILE20XXX208Sep192418.csv
MYFILE22XXX208Sep193234.csv
MYFILE21XXX208Sep193018.csv
MYFILE24XXX208Sep194053.csv... (5 Replies)
Discussion started by: krish_indus
5 Replies
7. Shell Programming and Scripting
$ cat file.txt
A|X|20
A|Y|20
A|X|30
A|Z|20
B|X|10
A|Y|40
Summing up $NF based on first 2 fields,
$ awk -F "|" 'BEGIN {OFS="|"}
{ sum += $NF }
END { for (f in sum) print f,sum }
' file.txt
o/p:
A|X|50
A|Y|60
A|Z|20 (4 Replies)
Discussion started by: uwork72
4 Replies
8. Shell Programming and Scripting
I come across the problems when assigning the array in the script below . How to use the array with the 'string index' correctly ? When I assign a new string index , the array elements that are previously assigned are all changed .:eek::eek::eek:
$ array=211
$ echo ${array}
211
$... (4 Replies)
Discussion started by: youareapkman
4 Replies
9. UNIX for Dummies Questions & Answers
brothers why inode index starts from 1 unlike array inex which starts from 0
its a question from the design of unix operating system of maurice j.bach
i need to know the answer urgently...someone help please (1 Reply)
Discussion started by: sairamdevotee
1 Replies
10. Filesystems, Disks and Memory
why do inode indices starts from 1 unlike array indexes which starts from 0
its a question from "the design of unix operating system" of maurice j bach
id be glad if i get to know the answer quickly
:) (0 Replies)
Discussion started by: sairamdevotee
0 Replies