?
Solved

How to extract a substr

Posted on 2008-10-29
4
Medium Priority
?
709 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 2000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Six Sigma Control Plans
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

777 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