Solved

How to extract a substr

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

706 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

19 Experts available now in Live!

Get 1:1 Help Now