Solved

How to extract a substr

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
capture pcap with filtered traffic 1 61
Hacked File Timestamps 4 62
Setting up two Raspberry Pi gateways/routers 3 62
Upgrade BIOS / EUFI at Scale 4 34
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

776 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