Sponsored Content
Top Forums Shell Programming and Scripting need help extracting this part Post 302196981 by finalight on Tuesday 20th of May 2008 02:43:45 AM
Old 05-20-2008
need help extracting this part

Code:
           JADE TRADER       143W       MYPEN  40   HC   M    X10    28    7	1      0
                                        MYPEN  20   GP   X    X10    15    2	1      0
                                        MYPEN  40   GP   X    X10    28    7	1      0
                                        MYPEN  20   GP   L    X10    15    2	1      0
       BUNGA TERATAI 3       5055       NZLYT  20   GP   X    X11    17    8	1      0
          MOL SPLENDOR      0307A       MUPLU  40   HC   X    X11    10    2	2      0
                                        MUPLU  40   HC   U    X11    10    2	1      0

i doing a script to extract the result and want the result to be like this

JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0
JADE TRADER 143W MYPEN 20 GP X X10 15 2 1 0
JADE TRADER 143W MYPEN 40 GP X X10 28 7 1 0
JADE TRADER 143W MYPEN 20 GP L X10 15 2 1 0
BUNGA TERATAI 3 5055 NZLYT 20 GP X X11 17 8 1 0
MOL SPLENDOR 0307A MUPLU 40 HC X X11 10 2 2 0
MOL SPLENDOR 0307A MUPLU 40 HC U X11 10 2 1 0

so how can I achieve this result, given that I do not know how many subsets are there for each of the first field..?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting uncommon part between two files

Hi, I need to extract the uncommon (better say incremental) part from 2 files say file_1 and file_2. file_2 contains everything that is in file_1. That is file_2 has been created internally somehow : cat file_1 temp_file > file_2 My objective is to extract the temp_file part from... (2 Replies)
Discussion started by: sabyasm
2 Replies

2. Shell Programming and Scripting

Extracting part of the basename

Hi, I was wondering if there is an easy way to strip off the required basename. I have a script called apb0110021.sh and the contents of the script are typeset -u MScript=`basename $0 | cut -d. -f1` scriptname=sys.Audit.ksh parms="PROJECT1 dsAudit $MScript 1 BEGIN" $SCRIPTS/$scriptname... (3 Replies)
Discussion started by: madhunk
3 Replies

3. Shell Programming and Scripting

Extracting part of a string

Hi all, I have to extract only the second part of a database column (VARCHAR) and the value is seperated by a "~" xyz~ chxyz36r~ abder~000082685 mnops~000083554 fulfil302~00026 Above are some examples of the values and for each record I have to extract the value after "~" , if there is a... (8 Replies)
Discussion started by: sam_78_nyc
8 Replies

4. Shell Programming and Scripting

Extracting a part of XML File

Hi Guys, I have a very large XML feed (2.7 MB) which crashes the server at the time of parsing. Now to reduce the load on the server I have a cron job running every 5 min.'s. This job will get the file from the feed host and keep it in the local machine. This does not solve the problem as... (9 Replies)
Discussion started by: shridhard
9 Replies

5. Shell Programming and Scripting

extracting part of a text file

Hi guys So I have a very large log file where each event is logged along with the time that it occurred. So for e.g. The contents of the file look like: ... 12:00:07 event 0 happened. 12:01:01 event 1 happened. 12:01:05 event 2 happened. 12:01:30 event 3 happened. 12:02:01 event 4... (10 Replies)
Discussion started by: alinaqvi90
10 Replies

6. Shell Programming and Scripting

Extracting part of line between two words

Hi, I have a file few hundred MB's with text like one below in single line. 20091117 abc xyg 20091117 def ghi 20091118 ppp ttt 20091118 zzz zzz xxx I need to extract part of line from 1st occurence of pattern 20091117 till first occurence of another pattern 20091118. I tried... (3 Replies)
Discussion started by: artistic94555
3 Replies

7. UNIX for Dummies Questions & Answers

Extracting part of a word

I have the code message={TP=2012:09:23:00:00:00:GMT,SD=2012:09:23:00:00:00:GMT,SP=2,FT=CCGT,FG=3605} I want to extract the FG=3605 parts of this. Please help. I am trying to do this using awk or unix. (5 Replies)
Discussion started by: JenniferTopham
5 Replies

8. Shell Programming and Scripting

Extracting a part of a string

Hi, I needed to extract some specific characters from a string based on user input. For example: After the script executes the user enters the following details: Please enter the string: This is a shell script Please enter the starting position: 11 Please enter the number of characters to be... (4 Replies)
Discussion started by: ChandanN
4 Replies

9. Shell Programming and Scripting

Extracting the part of string

I have a string: 2015-04-16 07:30:05,625000 +0900 xxxx.com I just want to extract the time from the above line I am using the below syntax x=~ /(.*) (\d+)\:(\d+)\:(\d+),(.*)\.com/ $time = $2 . ':' . $3 . ':' . $4; print $time But it is not working. Can some1 please help (2 Replies)
Discussion started by: karan8810
2 Replies

10. Shell Programming and Scripting

Extracting part of data from files

Hi All, I have log files as below. log1.txt <table name="content_analyzer" primary-key="id"> <type="global" /> </table> <table name="content_analyzer2" primary-key="id"> <type="global" /> </table> Time taken: 1.008 seconds ID = gd54321bbvbvbcvb <table name="content_analyzer"... (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies
plmpower(8)							     powerman							       plmpower(8)

NAME
plmpower - control Insteon/X10 devices via SmartLabs PLM 2412S SYNOPSIS
plmpower --device serial-port DESCRIPTION
plmpower is a helper program for powerman which enables communication with Insteon/X10 devices via SmartLabs Power Line Modem, model 2412S. It is run interactively by the powerman daemon. It can also be useful as a standalone tool for debugging X10/Insteon networks based on the above device. NETWORK SETUP
Note the addresses of your Insteon/X10 devices. Plug the PLM into an AC outlet, preferably on the same electrical phase as the devices under control. Devices are available to bridge phases if this is not possible. Attach the PLM's serial port to your computer, and ensure that nothing else is using the serial port such as the system console or getty(8). Run plmpower and try the interactive commands below to see if the devices respond reliably. Once everything is working, configure powermand to run plmpower as a coprocess as described in powerman.conf(5). OPTIONS
-d, --device serial-port Specify the path to the special file connected to the PLM's serial port. -t, --timeout msec Set the Insteon timeout to the specified number of milliseconds (default 1000). -x, --x10-attempts number Set the number of times to run every X10 command (default 3). X10 does not provide an ACK/NAK mechanism like Insteon so we cannot be certain that any particular X10 command completed, therefore X10 commands are issued multiple times to increase confidence. INTERACTIVE COMMANDS
The following commands are accepted at the plmpower> prompt. Address arguments may be Insteon (e.g. 1A.2B.3C) or X10 (e.g. G12). help Display help on the available commands. info Get info about the PLM. reset Reset the PLM (clears the all-link db). on addr Turn on device. off addr Turn off device. status addr Query status of device (Insteon only). ping addr Time round trip request/response to device (Insteon only). FILES
/usr/sbin/plmpower /etc/powerman/powerman.conf ORIGIN
PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. SEE ALSO
powerman(1), powermand(8), httppower(8), plmpower(8), vpcd(8), powerman.conf(5), powerman.dev(5), powerman-devices(7). http://sourceforge.net/projects/powerman powerman-2.3.5 2009-02-09 plmpower(8)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy