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
WIN XP wireless network connection
Help with Shell Script: find and move duplicate files in a directory tree
Formatting rows in DataGrid to reflect information in XML file
Two Panel gui design in C# 500 Points Urgent Need
Grant Permissions to Alter View
Can't Change Length of column from Varchar(50) to Varchar(100)
Visa Card Verification
Excel - Increment copy number on 2 page survey
Adwords Editor changes will not post to Google Adwords account
Format Date On Pivot Chart