I'm working on a file traversal and extraction function and am having problems.
So, my script is finding all files in a directory. Each file has the same format. I need to extract a field from the 4th line of each file..... hence why I am using the substring on NR == 4. So, I am extracting some names and I need to print out a list of unique names..... so, I was thinking of storing the names in an array list called Names. Then, at the end of my for loop, I want to invoke another awk script to print back the names in sorted order. But, everything I have tried hasn't worked. I'm not sure if there is a scope issue.... (by redeclaring another awk block, I can't read from the variables in the 1st block).
Am I approaching this script incorrectly? As you can tell, I'm new to AWK, and am having difficulties.
Hi,
I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1).
Input:
919143110065
919143110065
919143110052
918648846132
919143110012
918648873782
919143110152
919143110152
919143110152... (2 Replies)
Hi,
I have to get some value of the from a flat file and my file format is like this.
ABC
DEF
HIJ=1
XYZ
xyz
HIJ=2
So i need to make sure i get all the value of HIJ under XYZ and not ABC. (4 Replies)
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
hi guys,
i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB
MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00
MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00
this the file raw format:
Number of... (6 Replies)
Hi friends,
I was trying to traverse a file using FTS(3) . this is the code below.. but I am getting segmentation error in the line fts_read(...) ,
anybody have any idea , why it is?
Please, help me. Thanks in advance.... (2 Replies)
I almost have the entire script written. however the problem is how would i assign the global variable to terminate the process from the bottom up to ensure the child terminates so the parent can.
ex. I am proccess 1
I am proccess 2
etc
Here is the code
$ cat tree.c
... (3 Replies)