CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Table creation,updating,editing and deleting

 



raviperl
New User

Feb 2, 2009, 9:55 PM

Post #1 of 3 (1978 views)
Table creation,updating,editing and deleting Can't Post

I have a text file like following

This is regex forum
This is text
| | Perl | Monk | |
| | | | |

In the above i want to do
1) Replace Perl with the text which is taken from user from command line argument ***There could be anything instead of perl.Perl is just text here.


2)I want to delete the Monk column entirely.
3)I want to add one more column to the first row,so that i can add entries to it.
4)I want to add one empty row after the second row and in that i want to add some text in particular column say 2.



Deletion,updation and adding all these are the inputs that has to taken from user.

Eg:

If we want to delete the row means
$perl pgm.pl -del row 2
If we want to add the 2nd row in 1st column
$perl pgm.pl -add row 2 col 1 -title Tree
could anybody suggest me how to start this.I tried but got confusing and became my code messy.
so i want to start fresh one.Please it is little bit urgent as date coming closer.


FishMonger
Veteran / Moderator

Feb 3, 2009, 5:23 AM

Post #2 of 3 (1971 views)
Re: [raviperl] Table creation,updating,editing and deleting [In reply to] Can't Post

Since this is clearly a homework assignment, we can't provide a complete solution, but we can give you some guidance.

Start by reading the documentation for Getopt::Long
http://search.cpan.org/~jv/Getopt-Long-2.37/lib/Getopt/Long.pm


FishMonger
Veteran / Moderator

Feb 3, 2009, 5:45 AM

Post #3 of 3 (1969 views)
Re: [raviperl] Table creation,updating,editing and deleting [In reply to] Can't Post

If this is not for a homework assignment, as you stated in your PM to me, then please post your code and ask a specific question and include any warnings and errors that you're receiving.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives