- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Place 2 digit letter in a file at particular place
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 11:09 AM
тАО11-14-2008 11:09 AM
Place 2 digit letter in a file at particular place
Can anyone help me to place a code of 2 digits from a file and place into another file at a particular position
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 02:23 PM
тАО11-14-2008 02:23 PM
Re: Place 2 digit letter in a file at particular place
Example file snippets would make this a simple matter for many in the forums.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2008 02:34 PM
тАО11-14-2008 02:34 PM
Re: Place 2 digit letter in a file at particular place
Is it a particular position in every record or in one place in the file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:15 PM
тАО11-17-2008 01:15 PM
Re: Place 2 digit letter in a file at particular place
for everyfile we have to place a 2 digit code like"01" at position 31 and 32 at line 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:31 PM
тАО11-17-2008 01:31 PM
Re: Place 2 digit letter in a file at particular place
sed -e "1 s/\(.\{32\}\)/\1XX/" < YourFile
And if you meant to replace try:
sed -e "1 s/\(.\{30\}\)../\1XX/" < YourFile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:45 PM
тАО11-17-2008 01:45 PM
Re: Place 2 digit letter in a file at particular place
This is line number 1
00XXXXXXXXXX20081110XXXXXXXXXX00TT1
I want to place 45 after TT1 that position is 35 and 36
after placing it should be look like this
00XXXXXXXXXX20081110XXXXXXXXXX00TT145
could you please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:47 PM
тАО11-17-2008 01:47 PM
Re: Place 2 digit letter in a file at particular place
# sed -e "1 s/\(.\{30\}\)../\1XX/" < temp
"1" - This is the line to edit. It can be given a specific number, a range "2,7" or a pattern to match "/Customer/".
".\{30\}" - This will match any 30 characters and will work for our use. If we put a "^" at the start it would lock it to the first 30 characters on the line.
"\( \)" - These tell sed to remember the characters matched for use in the replacement string.
"." - This matches any single character
"\1" - The first (and only) pattern saved above
"XX" - Your special chars
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 01:55 PM
тАО11-17-2008 01:55 PM
Re: Place 2 digit letter in a file at particular place
By position:
# sed -e "1 s/\(.\{35\}\)/\145/" < temp
00XXXXXXXXXX20081110XXXXXXXXXX00TT145
By TT1:
# sed -e "1 s/TT1/TT145/" < temp
00XXXXXXXXXX20081110XXXXXXXXXX00TT145
By end of line:
# sed -e "1 s/$/45/" < temp
00XXXXXXXXXX20081110XXXXXXXXXX00TT145
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2008 02:12 PM
тАО11-17-2008 02:12 PM
Re: Place 2 digit letter in a file at particular place
Thanks You so much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-17-2009 02:04 PM
тАО02-17-2009 02:04 PM
Re: Place 2 digit letter in a file at particular place
In this reponses I did not see any drop down box to assign Point "unassigned" look like, I have assigned some of the response, could you tell me how to assign