sampath meka

sampath meka

  • NA
  • 94
  • 31.4k

Implement regular expression to a text file

Oct 31 2014 11:38 AM
Hello All,
                      I have one query regarding regular expression implementation to a file.I have a large text file in which i  am providing a set of lines has example:
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/SOURCE/yib_swa_signals.h 1.10.1.4 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_swa_signals.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/SOURCE/yib_swa_signals_sub.h 1.11.1.4 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_swa_signals_sub.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/SOURCE/yib_swa_signals_trim.h 1.4.1.5 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_swa_signals_trim.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_fault_manager\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_fwd_rev_detection\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/SOURCE/yib_swa_signals_priv.h 1.9 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_swa_signals_priv.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_initialization\yib_polyspace_drs.h

if i give filename has  yib_polyspace_drs.h  then i should get below lines has output from regular expression
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_fault_manager\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_fwd_rev_detection\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_initialization\yib_polyspace_drs.h
/SCS/SCS_Core_Based/08_Software/Application/YIB/YIB_GEN2/MAIN/APPLICATION/DOCS/Private/TestSpecifications/yib_polyspace_drs.h 1.3 d:\Sandbox\BMW35UP_I390_1.443_Testview\MainMicro\Application\Yib\Yib_Main\_yib_lat_accel_signals\yib_polyspace_drs.h 
Kindly help me to implement regular expression .
Thanks & Regards,
Sampath

Answers (9)