Programming :: Delete - Selected Rows In Perl / CGI?

Apr 6, 2010

How can I delete selected rows of a table in perl/CGI??

View 5 Replies


ADVERTISEMENT

Programming :: Deleting Rows From Text File In Perl?

Jun 21, 2010

How can I delete rows into text file in perl?

View 4 Replies View Related

Programming :: Script To Delete Selected Files?

Aug 4, 2010

I am writing a script to delete certain files
say

Code:
find / -name lighttpd
gives following output
Code:
/etc/init.d/lighttpd
/etc/lighttpd
/home/lighttpd
/opt/lighttpd-1.4.x/src/lighttpd

I do not want to delete file in home directory but rest all. In one shell script. So first line I am clear with but what can be the second line,

View 14 Replies View Related

General :: Script To Delete Selected BackupFiles And Restore Selected Backup File?

Jul 18, 2010

i am new to linux and i nid a bash script to Delete selected backup files and also restore selected backup file to a user define directory.

View 3 Replies View Related

General :: 'automate' That 'rows Selected' Preceded By Number Is Always Last Line

Jul 22, 2010

I'm not that familiar with sed and awk in order to be able to solve this problem on my own, so I'm calling on you for a bit of assistance. I'm writing a Nagios plugin to check our Oracle tablespaces and the output is given in one line like this: 1.04007771 TEMP 0 UNDOTBS1 .005340579 USERS 0 7 rows selected. I've been playing around with sed like below to delete the obsolete info and change every second space into a newline:

[code]...

how many tablespaces there are so I'd have to check all databases and 'hardcode' the tablespaces in my script. Is there any way to 'automate' this knowing that 'rows selected' preceded by a number is always the last line and using a sort of counter to auto-adjust the number to put in the -e 's/ / /2' part?

View 7 Replies View Related

Programming :: Delete Multiple Lines In A File Using Perl?

Apr 15, 2011

I have a file looks like the following:

digraph topology
{
"192.168.3.254" -> "10.1.1.11"[label="1.000", style=solid];
"192.168.3.254" -> "10.1.1.12"[label="1.000", style=solid];

[code]...

Order of these lines are random... So I cannot delete line #19, for example... And you can see that top four lines I want to delete are pairs. So there might be some clever way to detect the lines, if a line has both "1.9" and "1.11", then delete the line... I am new to perl language. The following is the code I have now... I think I just need to write some code inside the while loop checking if I want to delete the line $dotline before I write to a NEW file.

Code:

#!/usr/bin/perl -w
$TOPPATH = "/tmp";
$NAME = "topology";
$FILENAME = "$TOPPATH/$NAME.dot";

[code]....

View 16 Replies View Related

General :: Delete Rows Based On Values In A Column Using Sed?

Jan 18, 2011

I have a lot of files with thousands of rows and usually two columns of data. Column 1 is a coordinate, column 2 is a score. I want to delete rows that have a value in column 2 over, in this case, 50.

For example, here's a clip from a file:

2999898 39
2999899 40.9
2999900 42.7
2999901 44.7
2999902 46.7
2999903 48.9
2999904 51.1
2999905 53.3
2999906 55.7

I want the output to be this:

2999904 51.1
2999905 53.3
2999906 55.7

I know how to use sed for very basic things like deleting rows or ranges of rows but I can't figure out this ostensibly easy command.

View 6 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 :: How To Delete Selected Files?

Feb 10, 2010

Assumed I have the following files:

test12.txt
test13.txt
test14.txt
test15.txt

I want to delete the first 3 files with one command. How to do that?

View 8 Replies View Related

General :: Delete Selected Files From Sftp?

Apr 6, 2010

i am trying to delete multiple files from sftp with non-interactive way as per the desire ext. But i am not able to get the proper extension of the files for removing files.

lftp -u ${user},${passwd} sftp://${ip}<<EOF
cd ${path}
rm *${ext}
bye
EOF

View 4 Replies View Related

Ubuntu :: Make Shell Script To Delete Selected Entries Of A Log File?

Jun 26, 2010

I have 2 external hdd in wich I have all my files.... yesterday, I have copied all the files from hdd1 to hdd2 and I want to eliminate duplicates so I used FSLint to find them, now, I have a txt file that looks like this code...

now I want to make a shell script to delete all the files/entries (read from the log file) that begin with code...

View 2 Replies View Related

Programming :: Convert Columns To Rows

Aug 10, 2009

I bet this is a Perl one-liner (or very simple python script).I have a tab separated files in which each row looks like:Unique_Eight_Character_Sequence [3 tabs] data1~moredata1~moredata1 [3 tabs] data2~ moredata2~ moredata2 ... dataN~.The output file should have each column converted into a row (with the unique character sequence copied in for the first column), and then each "~" replaced by a comma.

View 14 Replies View Related

Programming :: Mysql Compare Two Rows

Aug 21, 2010

I would like to compare to mysql rows as follows:

Select count(*) from stocks2.historical where close*1.05 < (select open from stocks2.historical where date = date_add(date,interval 1 day))
and year(date)=2010;

The problem is with the "date" in bold... i want that date to be the date of the previous row. is there a way to do that purely with mysql? (naturally, i can write a script to go through and compare each date; what i'm asking for is a mysql solution.)

View 3 Replies View Related

Programming :: Placing Array Into Rows ?

Oct 27, 2010

In placing array data into while statement that will be looped to recreate more lines as information is populated.

unfortunately i'm not getting this to work.

PHP Code:

View 2 Replies View Related

Programming :: Have Files With Rows Of Data And Need To Check If The Next Row Of The Same Type?

Aug 16, 2010

I have a problem - I have files with rows of data and I need to check if the next row (of the same type) has the NEXT date in it so I need to extract a date in YYYYMMDD format from a row (easy enough) then add one day to it and compare it to the the next date I encounter on a subsequent row.

So if I have
DATE|20100530
VAL|kahskjhd

[code]...

View 6 Replies View Related

Programming :: AWK (or TCL/TK): Matching Rows And Columns Between Multiple Files?

May 26, 2011

I've been hitting my head against a wall for awhile with this one:As the last part of some data analysis I performing I would to construct a matrix from a series of different files. These files have the format:

file 1 file 2 file 3
AAAAA .1 AAAAA .1 BBBBB .1
BBBBB .2 BBBBB .1 CCCCC .9

[code]...

View 6 Replies View Related

Programming :: Get Number Of Rows And Columns Support In Screen?

Jul 18, 2011

In linux terminal; how can we get the number of rows ad columns from linux kernel? I tried from environment variables(LINES,COLUMNS) but, I could not retrieve them as my editor program is a child process to linux terminal process.

View 7 Replies View Related

Networking :: Granting Selected User Access To Selected Network Interface?

Oct 3, 2009

I have a multi-user machine with several network interfaces (Ethernet, if that matters). I wish to grant selected users, or groups, full access to selected network interfaces (including ability to adjust IP address and to bind to low ports, but *only* on those interfaces). It is important to me that an user/group does not such full control over other interfaces. Granting partial, or temporary, root permissions is OK; it's a friendly environment.How do I go about it?System: Linux 2.6.recent; usual Debian setup (can be adjusted if needed).

View 2 Replies View Related

General :: Finding A Recursive Shell Or Perl Script To Delete Files With The Same Name As The Parent Folder?

Jun 29, 2010

is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.

View 2 Replies View Related

Programming :: Command "join" Missing Some Rows?

Apr 30, 2011

Am a bit bewildered on the output of this "join" comad. I'm expecting it to output the 2nd and 3rd columns of both text1.txt and text2.txt. However, it somehow misses some of the columns from text1.txt. For example, rows 1, 2, 8, and 14 are working as expected. The rest of the row aren't.

Code:

cat text1.txt
20110429,10480,Y
20110429,5202,Y
20110429,19434,Y
20110429,19417,Y

[code]....

View 3 Replies View Related

Programming :: Get Name(s) Of File(s) Selected In Window Manager (gnome 2.32) In Bash Script?

Mar 12, 2011

Is there any way to get the name(s) of the file(s) selected in the window manager (gnome 2.32) in a bash script?

View 7 Replies View Related

Programming :: Socket Programming In Module Perl

Jul 21, 2010

Where is the perl module for programming with sockets?

View 4 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Programming :: Cannot Install Perl / Tk

May 9, 2010

I just downloaded Tk-804.028 and try to install it (according to the README.linux) but I get:

> perl Makefile.PL
/opt/ActivePerl-5.10/bin/perl-static is installed in /opt/ActivePerl-5.10/lib okay
PPM for perl5.010001
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c

[code]...

View 5 Replies View Related

Programming :: Perl Tutorial To Use?

May 18, 2011

Any recommendations on what Perl tutorial to use?

View 1 Replies View Related

Programming :: Converting MB/TB To GB In Perl?

Jan 30, 2010

I am taking an input from the user for free and Used capacity in a disk. I wish to convert Input entered in MBTB to GB and this is how i am doing it.

Code:

<some code>
print "Enter Total disk space";
$tot = <STDIN>;
convert($tot);

[code]...

how do i pass the value of conv[0] after conversion back to $tot or $use such that they contain only value which is in GB?

View 3 Replies View Related

Programming :: How To Get Perl Qt4 Working

Jul 24, 2010

I really would like Perl Qt4 bindings. The best I could find is this:[URL]The problem is that the sources would not compile, and the RPMs are for 32-bit machines.Is there really no such thing as good Perl Qt4 bindings?

View 8 Replies View Related

Programming :: MP3 - Tag And Perl Script

Mar 27, 2011

I am a newbie on linux and just searching everything about perl scripting and modules nearly 3-4 days. I need a perl script but one of not easy to find on searching google. Okay now I need a perl script which create or recreate (edit) id3 tags (artist, comment, album, year, cover) of mp3 files stored on my linux centos server. I installed MP3::Tag version 1.13 pearl module to my server. I Searched tutorials about how to use it, finally I get through reading id3 tag of mp3 file but not achieve to modify it or create a new id3tag.

These are the details:
I have a mp3 file called 1.mp3 this script will process that '1.mp3' file read its id3tag if there is one, than modify or create id3tag for it by my fix artist name for example:
'1.mp3' files id3 tag details are like this
Artist: Dj xx
Year:2010
Title:yyyyy
Comment:eerwer
Cover: x.jpg

Now via this perl script which uses MP3::TAG I will change it's
artist as YYY
Title:ttt
Comment:cool
Cover:t.jpg
these are gonna be my fixed values. I mean all '1.mp3' file will have same artist based on script value.

The reason of this script is I will share Dj podcasts on my server and Dj's would have upload their mp3's which has got different id3 tags and cover pics. etc. I want to create more organized podcasts of them by the way I would trigger this perl script via Cronjob.

View 14 Replies View Related

Programming :: How To Generate MD5 / Sha-1 With Perl

Mar 31, 2010

How can I generate a md5 or sha-1 code with perl?

View 2 Replies View Related

Programming :: Perl - Interpreter For Fib Numbers

Apr 1, 2010

As some of you know that I am new to this forum. I have another problem that I got stuck on. I have this file called "Fib.rbb" and my instructor told us to write an interpreter program by using Fib.rbb.

"You are to write an interpreter in Perl for Rongs Basic Basic (RBB) as explained in class. The BNF description for RBB and a test file called Fib.rbb are part of the RBB.zip file which is available in the Course Documents folder on blackboard. If you call your interpreter myIntp.pl, you would execute the program via perl myIntp.pl Fib.rbb

Code: Print "A few Fibonacci numbers:"

View 3 Replies View Related







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