LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-14-2010, 12:43 PM   #1
sridhar142in
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
Parsing a file into database


I am a new bee on this forum.

Can any one help me in parsing the text file in perl.I have very large text file with plenty of columns and rows.how can i parse the file into Oracle databse.

thanks in advance

Last edited by pixellany; 07-14-2010 at 01:48 PM. Reason: fix title
 
Old 07-14-2010, 01:25 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Welcome to LQ!

So you've shown us your need! What's your deed?

We will aid you when you help yourself to a solution. Provide us with what you have attempted and then maybe someone will be able to assist.

'How to Ask Questions the Smart Way' would be one link you should look at to help us to help you in the future.

Just a few links that may aid you;

Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Utimate Linux Newbie Guide
LinuxSelfHelp
Getting Started with Linux
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Home Networking


The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 07-14-2010, 01:51 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I fixed your title---Please use thread titles which are descriptive of the actual problem.

Why PERL?----there are lots of utilities that will parse text by column. e.g.: Have you looked at AWK?
 
Old 07-14-2010, 02:30 PM   #4
sridhar142in
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
parsing

Thanks for your email.My req is to use perl to parse.I have tried the following code.I am stuck at this point how can i proceed further,

<code>

open FILENAME "myfilename.txt";
While(<FILENAME>
{
@values = split(/\t/,$_);
$variable1 = value[0]
$variable2 = value[1]
.........
$variable20= value[20]

print@values
}
</code>
How can i insert all the values underneath those variables.
sample file name

var0 var1 var2 var3 var4 var5 ................................var20
1 2 3 4 5 6 .................................20
2.1 3.1 4.1 5.1 6.1 7.1 20.1
.
.
.
.
.
i have the file name like this please help me how i can insert all those values under the above variable names
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration