Sponsored Content
Top Forums Shell Programming and Scripting Read data from one file and putting in new file ?? Post 302265535 by wakhan on Sunday 7th of December 2008 10:44:52 PM
Old 12-07-2008
No this code is not giving any output in output file.

Code:
/omp/bin/TICLI "op:alarm,all" &
nawk '{$1=$1}/^CELL 6/{exit}/^CELL/' /omp/omp-data/logs/OMPROP1/081208.APX > all

Below code is giving output in output file but it is also getting other unwanted lines from LOG file.
Code:
/omp/bin/TICLI "op:alarm,all" &
nawk '/CELL 86/{exit}/CELL/{$1=$1;print}' /omp/omp-data/logs/OMPROP1/081208.APX > all

I just want those files which start from word CELL like this:
Code:

CELL 83, ASMB 1 TRANSMITTER AMP INDETERMINATE 5
CELL 83, ASMB 1 TRANSMITTER AMP INDETERMINATE 7
CELL 83, ASMB 1 TRANSMITTER AMP INDETERMINATE 8
CELL 83 RECEIVE AMPLIFIER INDETERMINATE 1


But above code is also getting lines like this:

A 46 REPT:CELL 65 CP FAILURE, UNANSWERED ORIGINATION
A 46 REPT:CELL 35 CP FAILURE, ANSWERED TERMINATION
A 46 REPT:CELL 7 CP FAILURE, UNANSWERED ORIGINATION

Regards,
Waqas Ahmed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read data from a file into a variable

I am a FORTRAN guy and not a UNIX expert by any means so sorry if this sounds dumb, but all I want to do is have a UNIX script which reads data from a file (say 1000 lines worth, each row is a file name) and store it in an array to perform an operation on later. As maddeningly simple as this... (2 Replies)
Discussion started by: yorkdg
2 Replies

2. Shell Programming and Scripting

Read from data file

Hi, I have a data file formatted like this: Ex: Mike 3434 Jack 481 Peter 12 Alan 926 I want to get this data into 2 variables: "Names" and "Numbers" that I can using one "for" loop to get the value as Names and Numbers Like this: for i in 0 1 2 3 do echo $Names echo... (12 Replies)
Discussion started by: fongthai
12 Replies

3. Shell Programming and Scripting

Post Shell programming: Question about source a file and read data from the file

This is shell programming assignment. It needs to create a file called .std_dbrc contains STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB (which includes all my simple database files) and I am gonna use this .std_dbrc in my script file (read the data from the database files) like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies

4. Shell Programming and Scripting

Read data in XML file

Hello Everybody, I have a question on reading the data from XML file through KSH shell script. In the below file I need to collect the patient control no and its respective insured id. I need to have pair of these values in single line separated by some special character, so that I could use... (2 Replies)
Discussion started by: swame_sp
2 Replies

5. Shell Programming and Scripting

Read the apecific data from one file and write into another file

Hi, I would like to read the specific data from file and write the data in the new file. My data input is something like this.. <EXROP:R=TJ0311T; ROUTE DATA R ROUTE PARAMETERS TJ0311T DETY=UPDR TTRANS=1 FNC=3 MA=628160955000 R=TJ0311D ... (3 Replies)
Discussion started by: bha148
3 Replies

6. Shell Programming and Scripting

Want to read data from a file name.txt and search it in another file and then matching...

Hi Frnds... I have an input file name.txt and another file named as source.. name.txt is having only one column and source is having around 25 columns...i need to read from name.txt line by line and search it in source file and then save the result in results file.. I have a rough idea about the... (15 Replies)
Discussion started by: ektubbe
15 Replies

7. Shell Programming and Scripting

Read file data and send to different file

junk.txt has a single numerical value in it, let's say 50421.44. over.namelist has lots of expressions in it, but somewhere random it says value = x.x I need to go into junk.txt, pull out the number, and amend over.namelist to say value = 50421.44. :(:( I'm trying to use sed, but... (5 Replies)
Discussion started by: jammyjames
5 Replies

8. UNIX for Dummies Questions & Answers

How to read data from zip file?

Hi All, could you please answer the below question. 1)How to read the data from zip file without unzip? Regards Priyanka (2 Replies)
Discussion started by: pspriyanka
2 Replies

9. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

10. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
tingea.log(7)							  MISCELLANEOUS 						     tingea.log(7)

  NAME
      tingea.log - How to set the Tingea log parameters

  DESCRIPTION
      The  Tingea  logging framework is part of the Tingea library.  In this context logging means that a pgrogram issues statements about what it
      is doing. It can do so for different purposes and at different levels of verbosity. By default logging statements are written on STDERR.

      Tingea logging provides a quick and easy way for programmers to associate verbosity levels with logging statements.  Only logging statements
      for which the verbosity level does not exceed the user-imposed threshold will be executed.  Users can easily regulate the verbosity level by
      setting the environment variable TINGEA_LOG_TAG.	Alternatively, programs may accept a command line argument.  The format accepted  by  both
      environment  variable  and command line argument is identical.  For the command line the programmer is free in choosing the option name.	It
      is customarily named -q.	The availability of such an option may vary from program to program.  However, any program that makes use  of  the
      Tingea logging facilities can be regulated with the TINGEA_LOG_TAG environment variable.	If a -q type option is present and the environment
      variable is set, then the environment variable is interpreted first followed by the -q argument.

      Tingea logging allows a programmer to assign categories to logging statements. The categories FUNCTION and DATA have a  subdivision  ranging
      from fine-grained to coarse-grained. The categorie MONITORING has a subdivision ranging from low priority to high priority.  The other cate-
      gories are unimodal. These are IO, THREAD, PROCESS, and GAUGE. Three unspecified unimodal categories are SLOT1, SLOT2, and SLOT3.  They  can
      be used to encode program-specific semantics.

      The  programmer  may  assign multiple categories to a single logging statement.  It is unusual for more than two categories to be specified.
      For example, IO and DATA at the LIST level may be combined to indicate a logging statement that provides data summaries  for  a  certain	IO
      related information. In order of granularity the DATA levels are CELL, LIST, and AGGREGRATE. If the user accepts IO logging and accepts DATA
      logging at level CELL or LIST the statement will be executed. If no IO logging is accepted or DATA logging is only accepted  at  the  AGGRE-
      GRATE level, the statement will be skipped.

      By  default,  all  categories  that are specified by the programmer need to pass the threshold specified by the user for that category.  The
      user may relax this requirement so that only one category needs to pass the user threshold. In the above example, the statement  categorized
      as both IO and DATA at LIST level will be accepted if the user specifies IO and DATA at AGGR level with OR semantics.

  SYNTAX
      The syntax of the TINGEA_LOG_TAG environment variable is described by

	 [[189x]]{<[dfgimpstABC][1-9]>*,[V]}

      which  translates to the following. An optional lead tag is followed by a concatenation of units. A unit is either a pair in [dfgimpstABC] x
      [1-9x] or the single character V.  The leading tag semantics are described further below.  The single character  V,  if  present,  specifies
      that OR semantics should be used rather than the default AND semantics. The semantics for the other units are given below.

	 d     DATA
		  1  CELL
		  2  LIST
		  3  AGGR
		  x  turned off

	 f     FUNCTION
		  1  LINE
		  2  FUNCTION
		  3  MODULE
		  4  APPLICATION
		  x  turned off

	 m     MONITORING
		  1  DEBUG
		  2  INFO
		  3  WARNING
		  4  ERROR
		  5  PANIC
		  x  turned off

	 g     GAUGE	|
	 i     IO	|
	 n     NETWORK	|
	 p     PROCESS	|  (Inter Process really)
	 t     THREAD	|______  1 on
			|	 x off
	 A     SLOT1	|
	 B     SLOT2	|
	 C     SLOT3	|

      The  leading  tag  can be used to set levels for all categories at once.	Subsequent units may then alter this intial setting.  The lead tag
      settings and their meaning are these:

	 1     d1f1m1g1i1p1s1t1A1B1C1	  # very yappy
	 9     d3f4m5gxixpxsxtxAxBxCx	  # very terse, only d f m
	 8     d3f4m5g1i1p1s1t1A1B1C1	  # less terse
	 x     dxfxmxgxixpxsxtxAxBxCx	  # silent

      All categories accept values between 1 and 9 in addition to the value x. As seen above, only a few categories contain more  than	one  level
      and no category contains more than five levels.  The rule is that if a level exceeds the maximul level available for a category it is simply
      interpreted as the maximum level.

      The GAUGE category, if set, indicates that a program may write line based progress bars or other output in which a single  line  is  accumu-
      lated  over  multiple  statements.  This	implies that a single GAUGE logging statement may not result in newline-terminated output. This is
      undesirable in case the logging stream is directed to a file that is written to by other applications as well. In that case, turn off GAUGE.
      All other categories are garantueed to result in line-terminated output, by virtue of the programmer contract.

  AUTHOR
      Stijn van Dongen.

  tingea.log 12-068						      8 Mar 2012						       tingea.log(7)
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy