Sponsored Content
Top Forums Shell Programming and Scripting Need help with awk - how to read a content of a file from every file from file list Post 302295716 by radoulov on Monday 9th of March 2009 10:51:04 AM
Old 03-09-2009
Yes, we must ask you to be patient.

Try this (use nawk or /usr/xpg4/bin/awk on Solaris):

Code:
awk -F\| 'FILENAME == ARGV[1] { 
  m[$1] = $2; next
  }
FILENAME == ARGV[2] { 
  n = split($0, t, "/"); f[$0] = t[n]
  ARGV[ARGC++] = $0; next
  }
{ 
  FNR == 1 && FS = "[ \t]*"  
  if (FNR == 2) 
  print FILENAME ": version", ($NF == m[f[FILENAME]] ? \
  "OK" : "mismatch " $NF " <-> " m[f[FILENAME]])
  }' mapVersion.txt ListOfFile.txt

 

10 More Discussions You Might Find Interesting

1. AIX

find for specific content in file in the directory and list only file names

Hi, I am trying to find the content of file using grep and find command and list only the file names but i am getting entire file list of files in the directory find . -exec grep "test" {} \; -ls Can anyone of you correct this (2 Replies)
Discussion started by: madhu_Jagarapu
2 Replies

2. Shell Programming and Scripting

Read a file and search a value in another file create third file using AWK

Hi, I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file. ... (11 Replies)
Discussion started by: King Kalyan
11 Replies

3. Shell Programming and Scripting

read a file and use the content for mapping

help me pls.. :( i want to read a mapping file. Below is the content of my mapping file. 6221,189,SMSC1,OMC1,WAP1 6223,188,SMSC2,OMC2,WAP2 so when my program running msisdn="622130302310" while not EOF if substring($msisdn,1,4) == "6221" -- > "6221" read from the file then echo... (0 Replies)
Discussion started by: voidmain
0 Replies

4. Shell Programming and Scripting

Read a file content with awk and sed

Hello , I have huge file with below content. I need to read the numeric values with in the paranthesis after = sign. Please help me with awk and sed script for it. 11.10.2009 04:02:47 Customer login not found: identifier=(0748502889) prefix=(TEL) serviceCode=(). 11.10.2009 04:03:12... (13 Replies)
Discussion started by: rmv
13 Replies

5. Shell Programming and Scripting

read file content

i have one file abhi.txt its contents are home8/mc09ats/UnixCw/backup/file1 home8/mc09ats/file2 i want to read this content of file using while loop.. in this i want to seperate the content as follows path=home8/mc09ats/UnixCw/backup file=file1 echo path echo file can you... (1 Reply)
Discussion started by: AbhijitIT
1 Replies

6. Shell Programming and Scripting

How to read file and only output certain content

Hi - I have a file containing data like :- cn=tommy,cn=users,c=uk passwordexpirydate=20100530130623z cn=jane,cn=users,c=uk passwordexpirydate=20100423140734z cn=michael,cn=users,c=uk passwordexpirydate=20100331020044z I want to end up with a file that looks like:-... (6 Replies)
Discussion started by: sniper57
6 Replies

7. Shell Programming and Scripting

cut the variable from the line and use it to find the file and read the content of that file

Hi, I am working on one script..I am having files in the below format file 1 (each line is separated with : delimeter) SPLASH:SPLASH:SVN CIB/MCH:MCH:SVN Now I want from file 1 that most left part of the first line will store in... (6 Replies)
Discussion started by: rohit22hamirpur
6 Replies

8. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

Read and concatenate content file and file name

Hi all, i need a bash script. I have a 3 file named Milano, Torino, Firenze Into file i have: Milano Marco Luca Giorgio Michele PatrizioTorino Marco Giulio Emilio MicheleFirenze Luca Giorgio Marco Saverio EmilioThe output should be a all_city.csv file like: (3 Replies)
Discussion started by: kamose
3 Replies

10. Shell Programming and Scripting

Use while loop to read file and use ${file} for both filename input into awk and as string to print

I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix. I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice. Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
GNUNET-STATISTICS(1)					      General Commands Manual					      GNUNET-STATISTICS(1)

NAME
gnunet-statistics - Display statistics about your GNUnet system SYNOPSIS
gnunet-statistics [options] [VALUE] DESCRIPTION
gnunet-statistics is used to display detailed information about various aspect of GNUnet's operation. This tool only works if the "statis- tics" service is available. gnunet-statistics can be used to set a value by giving the options -n, -s and also a VALUE. OPTIONS
-c FILENAME, --config=FILENAME Use the configuration file FILENAME. -h, --help Print short help on options. -L LOGLEVEL, --loglevel=LOGLEVEL Use LOGLEVEL for logging. Valid values are DEBUG, INFO, WARNING and ERROR. -n NAME, --name=NAME Each statistic has a name that is unique with in its subsystem. With this option, the output can be restricted to statistics that have a particular name. -p, --persistent When setting a value, make the value persistent. If the value used to be persistent and this flag is not given, it will be marked as non-persistent. -s SUBSYSTEM, --subsystem=SUBSYSTEM Statistics are kept for various subsystems. With this option, the output can be restricted to a particular subsystem only. -v, --version Print GNUnet version number. BUGS
Report bugs by using Mantis <https://gnunet.org/mantis/> or by sending electronic mail to <gnunet-developers@gnu.org> SEE ALSO
gnunet-service-statistics(1) GNUnet Jan 4, 2012 GNUNET-STATISTICS(1)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy