Advertisement

05.07.2008 at 11:49PM PDT, ID: 23385226
[x]
Attachment Details

Removing leading characters from list

Asked by m0nk3yza in Regular Expressions, Programming Languages, Bourne-Again Shell (bash)

Tags:

Hi All,

I need to remove the first 17 characters from a list of entries (containing 25 characters each).

I obtain the output from a select statement (mysql), which I then dump into a text file (called: DEVICE_LIST).

The serial number format is as follows (no spaces):

                  ABC200803140415218-XYZ567

Which is:
<CODE>      <DATE>            <TIME>            <SERIAL>
<ABC>      <20080314>      <041521>    <8-XYZ567>

I need to apply this to the DEVICE_LIST (100s of entries) and have the last 8 characters <SERIAL> remain (eg. 8-XYZ567).

What I want to achieve is something like:   cat  DEVICE_LIST  |  sed  -e  's/first 17 chars//g'  >  NEW_LIST

Please assist.

Thank youStart Free Trial
 
Loading Advertisement...
 
[+][-]05.08.2008 at 12:17AM PDT, ID: 21522861

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Regular Expressions, Programming Languages, Bourne-Again Shell (bash)
Tags: bash / perl / sed
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.08.2008 at 12:23AM PDT, ID: 21522901

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628