UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 18th, 2012, 07:04 PM
Unixnew Unixnew is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 1 Unixnew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 30 sec
Reputation Power: 0
Search - Verify and Replace

Hello All,

I am fairly new to Unix and looking for a solution for a below prob
Content of a file x

223001ABCD
2210015ABCD
221007ABCD
2230015ABCD
223004ABCD

I am looking for a way where I need to search in the file
1. First for Unit Code - '223' ( Position 1 to 3)
2. If Position 6 is '1' & Position 7 between '0' & '5'
do nothing
else
Add space on position 6

The Modified output inside file x
22300 1ABCD
2210015ABCD
221007ABCD
2230015ABCD
22300 4ABCD

Reply With Quote
  #2  
Old December 19th, 2012, 10:41 AM
LKBrwn_DBA's Avatar
LKBrwn_DBA LKBrwn_DBA is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2006
Posts: 752 LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level)LKBrwn_DBA User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 3 h 5 m 12 sec
Reputation Power: 348
Wink

Quote:
Originally Posted by Unixnew
Hello All,

I am fairly new to Unix and looking for a solution for a below prob
Content of a file x
. . . Etc . . .

Good homework assignment!
Easy to solve if your teacher allows you to use 'awk'.

Good luck!
__________________

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Search - Verify and Replace

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap