Sponsored Content
Full Discussion: Help on sed/awk
Top Forums Shell Programming and Scripting Help on sed/awk Post 302665781 by rakeshv on Tuesday 3rd of July 2012 07:25:36 AM
Old 07-03-2012
Hi Yayan, thanks for the quick reply...

The expected output can be in a separate file as well but it should have the entire records if the attempt made is more than 2.

If you see my original data it contains the 3 record since the Attempt made is 0, it has to be ignored and the expected output should be...

Code:
================================================================================

 Autootaal                              8711768000011                 (AUTOTAAL)
--------------------------------------------------------------------------------

 Directory Entry Type........... N
 Last Call :....................
    Date/Time................... 07/03/09 12:36:29
    Status...................... Successful
    Attempts....................   0
 Max. call retries.............. 999  at   10 minute intervals
================================================================================

 Audi Files to ETS System               AUO0932109936351TAE           (AU2ETS00)
--------------------------------------------------------------------------------

 Directory Entry Type........... N
 Last Call :....................
    Date/Time................... 06/02/21 16:01:06
    Status...................... Ftp Code = 000  X.25 Cause = 013  X.25 Diag =
    Attempts....................   7
 Max. call retries..............   7  at   10 minute intervals
================================================================================

---------- Post updated at 06:25 AM ---------- Previous update was at 06:14 AM ----------

Awesome!!! fantastic.... thanks a lot Scrutinizer.
It was fast.. Can you please help me understand this piece..

Last edited by Scrutinizer; 07-03-2012 at 09:15 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk / sed

I have many messages such as the test message below: 00:00000:00021:2002/05/13 13:57:00.51 ERROR:- Test error, my test error!!! I am writing a script in which I need to get everything from the word "ERROR:-" onwards. I normally use awk for these things, but I am not an expert at it so i am... (6 Replies)
Discussion started by: baileyr1
6 Replies

2. Shell Programming and Scripting

sed,awk

Hi, I know sed is stream text editor and not a bit more than that. Can anyone explain its usage and advantages? How is awk different from sed? I donno i am a bit confused about it. But i have coded in awk and shell. Thanks, Nisha :confused: (7 Replies)
Discussion started by: Nisha
7 Replies

3. UNIX for Advanced & Expert Users

sed in awk ? or nested awk ?

Hey all, Can I put sed command inside the awk action ?? If not then can i do grep in the awk action ?? For ex: awk '$1=="174" { ppid=($2) ; sed -n '/$ppid/p' tempfind.txt ; }' tempfind.txt Assume: 174 is string. Assume: tempfind.txt is used for awk and sed both. tempfind.txt... (11 Replies)
Discussion started by: varungupta
11 Replies

4. UNIX for Advanced & Expert Users

Awk or Sed help

Hi, I have a data file with 5 columns - like this: "20080401 09:43:08.770798 +0100s","TEST 1","R 1","A TEST","Nov 27 2007","1" "20080401 09:43:08.770798 +0100s","THIS IS A TEST","R 2","B TEST","Nov 30 2007","10" "20080401 09:43:08.770798 +0100s","ANOTHER TEST","R 3","B TEST","Nov 05... (7 Replies)
Discussion started by: MrG-San
7 Replies

5. UNIX for Dummies Questions & Answers

sed or awk?

I've got an inventory database with eight columns with things like product name, manufacturer, UPC code, etc. on each line. Our PO (purchase order) number is in the first column. I can grep the date and get the full line of data but I would like to strip out everything but the PO number in the... (5 Replies)
Discussion started by: NetJones
5 Replies

6. Shell Programming and Scripting

Using sed or awk?

What if I wanted to add a word such as IT after the first character and if theres 3 characters, after the 2nd character? output would be: G, it H G, H it P G, H, P it L I'm thinking that AWK would be the easiest way to do this... Currently looking it up. Right now I'm using awk but I... (13 Replies)
Discussion started by: puttster
13 Replies

7. Shell Programming and Scripting

Need help using awk or sed.

Hi All, Is there a way of comparing two columns in the same file and deleting the row if the values of the columns match. I have the sample data file as below. M024900|175309.00|968.00|17 M025001|19861.79|97.90|148 M025002|431.70|159.00|3 M025003|912.30|159.90|6 ... (6 Replies)
Discussion started by: nua7
6 Replies

8. UNIX for Dummies Questions & Answers

sed/awk or help please

I have a file that contain the data below: B1 1 2 3 B2 20 30 40 B3 7 8 B4 100 B5 21 22 23How can I retrieve the data for B1 into a seperate file. (8 Replies)
Discussion started by: bobo
8 Replies

9. Shell Programming and Scripting

Is this possible using SED and AWK?

Dear Geeks, I want to manipulate a file with certain modifications for that using sed or AWK how to do this process for one file i have this type of data. Input File: "Restricted and Reserved names .ANISH",3798,"TEST.CO",1201208,6/16/10 0:00,6/16/13 0:00,,,"CO","2nd"^M "Restricted and... (4 Replies)
Discussion started by: anishkumarv
4 Replies

10. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies
POWERPANEL(8)							    NUT Manual							     POWERPANEL(8)

NAME
powerpanel - Driver for PowerPanel Plus compatible UPS equipment NOTE
This man page only documents the hardware-specific features of the powerpanel driver. For information about the core driver, see nutupsdrv(8). SUPPORTED HARDWARE
This driver supports CyberPower BC1200, PR2200 and many other similar devices, both for the text and binary protocols. The driver will autodetect which protocol is used. EXTRA ARGUMENTS
This driver supports the following optional settings in ups.conf(5): protocol=[text,binary] Override the default autodetection of the protocol. manufacturer=value If you don't like the autodetected value, you can override this by setting it here. model=value Like manufacturer above. serial=value Like manufacturer above. ondelay=value Time to wait before switching on the UPS (1 - 9999 minutes, 0=indefinite). Only available with the text protocol driver (see Support Status). offdelay=value Time to wait before shutting down the UPS (6 - 600 seconds). Values below 60 seconds will be truncated to 6 seconds intervals, values above 60 seconds to 60 seconds intervals. Only available with the text protocol driver (see Support Status). VARIABLES
Depending on the type of your UPS unit, some of the following variables may be changed with upsrw(8). If the driver can't read a variable from the UPS, it will not be made available. input.transfer.high writable: high transfer voltage point in V input.transfer.low writable: low transfer voltage point in V battery.charge.low writable: remaining battery charge percentage for low battery warning output.voltage.nominal writable: nominal output voltage in V ups.start.battery writable: allow cold start from battery COMMANDS
Depending on the type of your UPS unit, some of the following commands may be available. o test.battery.start.quick, test.battery.stop o beeper.enable, beeper.disable, beeper.toggle o shutdown.return, shutdown.reboot, shutdown.stayoff On many devices, these commands are unreliable, so before using them you must verify that these work as expected (see Shutdown Issues). o shutdown.stop SUPPORT STATUS
Vendor support is absent for this driver, so if you need some features that are currently not available, provide ample documentation on what the driver should sent to the UPS in order to make this work. If more information would be available on the binary protocol, it would probably be possible to make ondelay and offdelay configurable. So far, nobody has taken the time to investigate what we should tell the UPS to make this work, and CyberPower isn't willing to share this with us. SHUTDOWN ISSUES
If the shutdown.return command on your UPS doesn't seem to work, chances are that your UPS is an older model. Try a couple of different settings for offdelay. If no value in the range 6..600 works, your UPS likely doesn't support this. In order to get the expected behaviour, it requires shutdown.stayoff (when on battery) and shutdown.reboot (when on mains). The driver will automatically fallback to these commands if shutdown.return fails, and tries to detect which one should be used when called with the -k option (or through upsdrvctl shutdown). This isn't bullet-proof, however, and you should be prepared that the power will either not be shutdown or that it doesn't return when the power comes back. All models supported by the binary protocol and many supported through the text protocol are affected by this. KNOWN PROBLEMS
The CyberPower OP series don't offer direct voltage, charge, frequency and temperature readings. Instead, they will return a binary value that needs conversion to the actual value. The exact conversion needed is unknown at the time of this writing, hence an estimation was made based om readings from actual devices. This may (probably will) be off, possibly a lot. Unless you can tell us the exact mapping between values from the UPS and actual readings, don't bother to complain. We've done the best we can based on the limited information available. Remember, a UPS isn't a measuring instrument. AUTHORS
Arjen de Korte <arjen@de-korte.org>, Doug Reynolds <mav@wastegate.net> SEE ALSO
The core driver: nutupsdrv(8) Internet resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 POWERPANEL(8)
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy