Solved

How to extract a substr

Posted on 2008-10-29
4
704 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle 12c patching 1 61
route 2 traffic streams on single NIC 6 36
VMware Workstation 12 Player 16 40
Linux VM 6 48
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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 …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

910 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now