General :: Perl On Line To Take Out Select Values?

Jan 22, 2010

This is a Fix message - it is a type of protocol for transmitting financial dataeach number followed by a = sign is a tag - each tag means something. some tage are moe important than other.

8=FIX.4.1^9=0235^35=D^34=10^43=N^49=VENDOR^50=CUSTOME^ 56=BROKER^52=19980930- 09:25:58^1=XQCCFUND^11=10^21=1^55=EK^48=277461109^22= 1^54=1^38=10000^40=2^44=76.750000^59=0^10=165 18

[code]....

View 9 Replies


ADVERTISEMENT

General :: Parse A Line From A File And Place The Values Into Separate Variables?

Sep 28, 2011

I am trying to parse a line from a file and place the values into separate variables:

input.txt:

Code:

CreateVegaFeed-20110928-before-skip-start

this is the code i have done so far:

Code:

$input_file="input.txt"
INPUT_FILE=`cat $input_file`
for i in $INPUT_FILE

[Code].....

View 14 Replies View Related

Programming :: Perl Script To Replace Line After Finding Previous Line

Feb 28, 2011

At the moment I have a flat file which is being used by a few people. I want a script to remotely change the file, so I can start logging who is doing what.At this point here is one requirement I am trying to develop. We have text blocks who pretty much look like.I hope this is somewhat clear. I try to find $param for the right $workflow and change that. Can you help me to find $$var3 and change that?

View 1 Replies View Related

Programming :: Perl - Delete Line From Text File With Duplicate Match At Beginning Of Line

Apr 1, 2009

Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):

There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.

If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.

View 7 Replies View Related

General :: Perl Command To Replace String By Line Numbe?

Jul 10, 2010

I want to know the Perl command to replace a string by pointing the line number. I know how to replace a string without pointing a line number but I am in need to replace only the two matching string in a file

View 6 Replies View Related

Programming :: Perl Script To Read Line By Line

Aug 2, 2011

I just learn perl script.May i know how to simplify the code below especially in the red color part? i saw some examples in internet, they use "next" command.

View 20 Replies View Related

Red Hat / Fedora :: Bash - Echo Multiple Numeric Values On One Line

Aug 9, 2009

I'm trying to get multiple numeric valued version information into a variable, all on the same line. I want for example $VERSION=3.1.0.01.002. I'm trying to pull seperate values from the file named version.properties, wherein the file contains;

patch.rel.num=0
sqa.num=01
major.rel.num=3
build.num=002
minor.rel.num=1

So I have the following script:
#!/bin/bash
BUILDVERFILE="version.properties"

PATCH=`grep "patch.rel.num" ${BUILDVERFILE} | awk {'print $1'}`
SQA=`grep "sqa.num" ${BUILDVERFILE} | awk {'print $1'}`
MAJOR=`grep "major.rel.num" ${BUILDVERFILE} | awk {'print $1'}`
BUILD=`grep "build.num" ${BUILDVERFILE} | awk {'print $1'}`
MINOR=`grep "minor.rel.num" ${BUILDVERFILE} | awk {'print $1'}`

P=`echo $PATCH | tr -d .=[:alpha:]`
S=`echo $SQA | tr -d .=[:alpha:]`
MA=`echo $MAJOR | tr -d .=[:alpha:]`
B=`echo $BUILD | tr -d .=[:alpha:]`
MI=`echo $MINOR | tr -d .=[:alpha:]`

VERSION=$MA.$MI.$P.$S.$B
echo $VERSION #

I end up with the value of .002 ?? Seems like it's only getting the last portion because if I run the script thru "bash -x" I get:
...
+ VERSION=$'3
.1
.0
.01
.002
'
+ echo $'3
.1
.0
.01
.002
'
.002

View 7 Replies View Related

Ubuntu :: How To Invert Select From The Command Line

Nov 23, 2010

I was thinking as we have an option for invert selection , is there any option for invert deletion from command line. We can invert select and then pass the output to deletion, but i dont know how to invert select from the command line.

View 5 Replies View Related

Software :: Top: Select The Shown Fields From The Command-line?

Feb 8, 2010

I want to select the fields which the 'top' command shows from the command-line. I can do that in the interactive mode when I press 'F', but I would love to do it via parameters (or with a configuration file, if it doesn't work otherwise).The fields I'd want to leave out are triggered by these letters: AHIOQTWMBackground:I installed the "compa" Gnome applet and want to always see what program currently uses up most ressources. For example, Pidgin sometimes starts using up 100% of 1 CPU and I have to kill it and start it again. I can already filter 1 or 2 programs from the 'top' command using the 'head' and 'tail' commands, but there are too many fields for my purposes by default. I could make a C program that filters those fields I need, but I think there must be a simpler solution.

View 2 Replies View Related

Programming :: Using Perl - How To Chomp Every 2nd Line

Feb 4, 2010

I'm trying to chomp the new line character off of every 2nd line in a CSV file

[code]...

The above code gives me this error: Filehandle FILE opened only for output at SCR.pl line 7.

View 14 Replies View Related

Debian Hardware :: Connector Difference Between 3.5 And 5.25 Drives On Drive Select Line?

May 17, 2010

I am trying to read a 5 1/4 in. floppy disk using an Intel D865 PERL motherboard, at 3 GHz. Bios was set to read this floppy. The system Lenny 2.6.31 i386 can't detect the 5.25 drive. Drive select seems not to be responding on the 5.25 drive. When connecting a 3 1/2 in. drive to the same motherboard connector (after changing the BIOS setting appropriately), r/w is ok under both linux and XP. I have tried three floppy 5.25 drives and different cables. All known to be ok on another box. I have tried XP and another linux, Etch. I have installed the latest available Bios upgrade from Intel. Upgraded from 0061 to 0089 bios versions. Is this a possible connector difference between 3.5 and 5.25 drives on the drive select line? The cable drive end connectors are different between the two drives.

View 5 Replies View Related

Ubuntu :: Run Perl File From Command Line?

Jul 24, 2010

I'm trying to run a perl script found at http://wiki.scribus.net/index.php/Web_optimised_PDF.

running "compress-newsletter.pl input.pdf" produces the result:

-bash: compress-newsletter.pl: command not found

View 4 Replies View Related

Programming :: How To Append A String To A Next Line In Perl

Apr 9, 2010

I have a requirement like this..this just a sample script...

Code:

when i run this scipt...

Code:

Code:

It is appended in the same line...

I want it to be added to the next line.....

I want to do this by explitly using the filehandles in perl....and not with redirection operators in shell.

View 1 Replies View Related

Programming :: Output Coming In New Line In Perl?

Feb 22, 2010

Here is some line I have written in perl to show my name :

[code]...

And after stdin kumar, its giving the output as

[code]...

output should be [code]... but why its coming in two lines?

View 2 Replies View Related

Programming :: Perl - Way To Encrypt Command-line Input When User Enter A Password ?

Nov 4, 2010

I need user to input a password through command line in Windows cmd prompt. Is there a way to encrypt the input (such as put it into ......) when user is typing ?

View 2 Replies View Related

General :: Use "#!/usr/bin/perl" In The Beginning Of A Perl Script

Dec 17, 2010

I have a small problem with Perl and Apache.

If I use "#!/usr/bin/perl" in the beginning of a perl script the script won't work if the script is at all complicated. Simple scripts like "Hello World" works.

But if I use "#!/usr/bin/perl -w" in the beginning all scripts work?

If I don't use the -w this is whats in the logs:

(2)No such file or directory: exec of '/home/test.net/html/cgi-bin/uh/meny.pl' failed

Premature end of script headers: meny.pl

When I use the -w in the script the error-log shows me this.

meny.pl: Name "main::http_path_cgi" used only once: possible typo at /home/test.net/html/cgi-bin/uh/meny.pl line 24.

View 1 Replies View Related

General :: Bash - Use Sed To Get Values From File Name?

May 26, 2011

how to retrive every portion separately from following file name? DSA4020_frontcover_20346501_2011-05.doc

I want to retrieve informations as below;

name = DSA4020
type = frontcover
id = 20346501
date = 2011-05

is it possible to do with sed??

View 4 Replies View Related

General :: Why Priority Values Of Process Different

Oct 7, 2010

Code:
# ps
22355 pts/3 00:00:00 bash
#
# ps -l 22355
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 S 519 22355 22354 0 75 0 - 1338 wait4 pts/3 0:00 -bash
#
# ps -o pid,priority,command 22355
PID PRI COMMAND
22355 15 -bash
#

Why are the priority values of the process different? What is the difference? Is the value 15 the "nice" priority? Then, what is the value 75? Please, explain the difference of each result.

View 4 Replies View Related

General :: Hex Values Converting Inconsistently?

Dec 19, 2010

I couldn't really decide where this should be posted, but this is the most general of the forums. Anyway, I've been playing a wargame on intruded.net in which some of the challenges require me to pass hexvalues into the programs as character values. All is well with this, and usually I would use the shell to pass it in, but most of these programs use the gets() method to get my input.

Here comes the problem... The other day I was using my desktop which runs slackware 64 13.1 to do these challenges. My method was to use "echo -e 'xefxbexadxde'" to print them to the shell's standard output and then highlight and copy the resulting values to paste to the program. This works just fine on slackware, but when I repeated the same processes on Ubuntu 64 10.04 (which runs on my laptop) the 'xde' always turns up to be 'x00'. Then I tried some other levels with similar responses, not all the hex values convert to the correct ASCII characters.

View 2 Replies View Related

General :: Pass Two / Three Values To Grep?

Sep 22, 2010

Is there any way i can pass two / three values to grep. Basically i want to list the lines in the file with three different values. Currently I'm using three grep to get my work done.

EG: more Filename | grep text1 | grep text2 | grep text3
BRs

View 2 Replies View Related

General :: Replace Values In Log File?

May 14, 2010

I have the following values in my log file:

...
2010-05-13 11:00:00 k_TRANSFER OK (11)
2010-05-13 11:30:01 m_TRANSFER OK (21)
2010-05-13 12:00:00 k_TRANSFER OK (12)
2010-05-13 12:30:00 m_TRANSFER OK (32)
2010-05-13 13:00:00 m_TRANSFER OK (13)
...

I want to replace every number with it's decrement. For example, the above values should be:

...
2010-05-13 11:00:00 k_TRANSFER OK (10)
2010-05-13 11:30:01 m_TRANSFER OK (20)
2010-05-13 12:00:00 k_TRANSFER OK (11)
2010-05-13 12:30:00 m_TRANSFER OK (31)
2010-05-13 13:00:00 m_TRANSFER OK (12)

View 5 Replies View Related

General :: How To Set Ulimit Values As Default

Mar 18, 2010

I need to set ulimit values according to
I used
Code:
ulimit -c unlimited
ulimit -s unlimited
ulimit -u unlimited
But after I log again to my session values are set to default. Now can I set this values so they don't change after log out of after reboot?

View 2 Replies View Related

General :: CPU Speed Stepping And Nice Values?

May 25, 2010

My cpu is set via Gnome-power manager to automatically speedstep under demand....

the thing is i have a few nice level 19 processes running most the time that eat up all the idle time, this forces my clock speed up and as such makes the fan noisy and uses more power...

basically what i would like to do is to ignore process load with a nice over a certian level when determining weather to speed step.

View 4 Replies View Related

General :: 'set' Command To Output Vars Without Values?

Sep 3, 2010

I need a list of shell variables without values and without finctions. Can't find an option for set or typeset to print values only

View 4 Replies View Related

General :: What Means Values Of Load Average?

Jan 20, 2011

Anyone know what means the values of Load Average?

load average: 0.00, 0.00, 0.04
load average: 17.50, 13.44, 12.70

Sometime is low and many times is high.

View 1 Replies View Related

General :: Replacing Empty Values In Bash?

Mar 11, 2011

I'm executing the below bash script, but when the m variable doesn't get any value it becomes empty. I don't want that.

Code:
for i in "$@"
do
m=$(grep TOTAL_MAPS $i | awk '{ print $2}');
totalmaps+="<string>"$m"</string>"

[Code]....

View 6 Replies View Related

General :: Send Mail If All Values In Second Field Are Zero?

Sep 1, 2010

In my file there are 2 fields separated by space.Sample content of file are as follows:56060 154242 053030 0Now i want to check second field of the file and if all values in second field are 0(zero) and send mail containing all contents of the file

View 3 Replies View Related

General :: What Is Default Kernel Parameter Values

Mar 3, 2010

What is the default kernel paramtre valus for linux RHEL Machine?

View 5 Replies View Related

CentOS 5 Server :: Move 5.5 To /usr/bin/perl So Root Based On Perl 5.12.1?

Aug 11, 2010

I am new here and want to lern CentOS. Current I have installed CentOS 5.5 x64 and Perl 5.8.8. Now i have install Perl 5.12.1 which located to /usr/local/bin/perl. But how I can move it to /usr/bin/perl so root based on Perl 5.12.1?

View 7 Replies View Related

Debian :: Launch The Perl Config \ Seems To Be That It Does Not Regonize Perl?

Jul 7, 2010

I am trying to launch the perl config, but when I do so I can an weird error.It seems to be that it does not regonize perl ?

conf.pl: line 11: =: command not found
conf.pl: line 19: my: command not found
conf.pl: line 20: syntax error near unexpected token `{'

[code]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved