Microsoft
Software
Hardware
Network
Question : Script to extract pattern
Given the following string:
file="JYAX3-0501MT011027AA
E2U2APP.jp
g"
Using a bash script I need to extract 011027 from it to use as a variable later in the script. Using sed or awk how would I go about doing this? There is a long list of these file names but they all have the same pattern.
Thanks,
Scott
Answer : Script to extract pattern
awk '/[0-9][0-9][[0-9][[0-9][A
-Z][A-Z][0
-9][0-9][[
0-9][[0-9]
/{print substr($0,match($0,/[0-9][
0-9][[0-9]
[[0-9][A-Z
][A-Z][0-9
][0-9][[0-
9][[0-9]/)
+6,6)}'
Random Solutions
Why are animated gifs in emails static?
mysql nested SELECT
cgi bypass
How to do search on special characters in MS SQL?
OWA Reminder Popup Script Error
Internal error 2753. nost_LM.exe Windows Installer or Installshield issue
Create Batch file to setup ODBC DSN on the fly
Backup Server fails with Net-Library routine net_listen() failed in srv__start_net Network error: status = 23 - Net-Lib protocol driver call to register a listener failed
Terminal Services Profile Problem
SBS - Sharepoint 2007