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: Beginner:
String Separation in a file

 



Mcampb9713
Deleted

May 2, 2000, 10:15 PM

Post #1 of 3 (475 views)
String Separation in a file Can't Post

If my data is separated by comma as in the below, I cannot use the s+ to separate the word... Does anybody know what to use... sample data and string to break up the data below:

String to break data:
$string =~ /^(\w+)\s+(\d+\/\d+\/\d+)\s+(\d+:\d+:\d+)\s+(\w+)\s+(\d+)\s+(\w+)\s+(\w+\W\w+)\s+(\w+)/; #\s+(\D+-\w+)/; #\s.*(\bHQ.*|ALT.*\b)/;

I am putting each field in the variable below to load the data into Oracle:

$NTID=$1; $Date_event=$2; $Time_event=$3; $User_accnt=$4; $Event_ID=$5;
$Type_Event=$6; $Computer_Event=$7; $Source_Event=$8; $Server_name=$9; $End_word=$10;

DATA:
SEC,2/14/00,22:11:52,Security,517,Success,System Event ,NT AUTHORITYSYSTEM,HQ-S-N-00,SYSTEM NT AUTHORITY Primary
SEC,2/14/00,22:12:11,Security,528,Success,Logon/Logoff ,HQSRusso,HQ-S-N-00, SRUSSO HQ 3 KSecDD MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 HQ-W-W-23C4

SEC,2/14/00,22:16:19,Security,528,Success,Logon/Logoff ,HQHQBackup,HQ-S-N-00, HQBackup HQ 3 KSecDD MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 HQ-S-N-01


japhy
Enthusiast

May 2, 2000, 10:40 PM

Post #2 of 3 (475 views)
Re: String Separation in a file [In reply to] Can't Post

Try using \s* which means "0 or more spaces".


Mcampb9713
Deleted

May 3, 2000, 11:04 AM

Post #3 of 3 (475 views)
Re: String Separation in a file [In reply to] Can't Post

The \s* did not work....

Help

 
 


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

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