Solved

How to extract a substr

Posted on 2008-10-29
4
707 Views
Last Modified: 2013-12-16
need to extract the path of the file between the "" from the data below! I need this urgently!


23-Oct.16:43   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTaxSegAbsorbSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:44   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTransfersInfo1SQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetPfcEssAirSvcSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:40   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetPaxTypeSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:40   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetPaxTypeMatrixSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:44   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTrfInhibSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:28   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetZoneSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetPfcExemptionSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetPFCSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:44   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTpdPsrSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetRoutingSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:43   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTaxCodeSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:44   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetVendXrefSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:45   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetYQYRFeesSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetRoutingForMarketSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
0
Comment
Question by:EmadGirgis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 22833589
try

awk -F'"' filename

filename is the file that contains the lines you posted
0
 
LVL 14

Accepted Solution

by:
Deepak Kosaraju earned 500 total points
ID: 22833590
tail -f log | cut -d " " -f 9

0
 
LVL 14

Expert Comment

by:Deepak Kosaraju
ID: 22833614
KOSARAJUS:~ KOSARAJU$ cat test.log
23-Oct.16:43   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetTaxSegAbsorbSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
23-Oct.16:41   sg912681   checkout version "/vobs/atseintl/DBAccess/Queries/QueryGetRoutingForMarketSQLStatement.h" from /main/atsev2_Integration/OracleTaxV2/0 (unreserved)
KOSARAJUS:~ KOSARAJU$ tail -f test.log | cut -d " " -f 9
"/vobs/atseintl/DBAccess/Queries/QueryGetTaxSegAbsorbSQLStatement.h"
"/vobs/atseintl/DBAccess/Queries/QueryGetRoutingForMarketSQLStatement.h"


0
 
LVL 39

Expert Comment

by:Adam314
ID: 22833634
Using perl:
    perl -an -F/\"/ -e 'print "$F[1]\n"' test1.txt

Or as a perl program instead of command line:
  open(my $in, "<file.txt") or die "Could not open file: $!\n";
  while(<$in>) {
      my @F=split/"/;
      print "$F[1]\n";
  }
  close($in);
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question