replacing text in specific location


 
Thread Tools Search this Thread
Operating Systems HP-UX replacing text in specific location
# 1  
Old 07-19-2007
replacing text in specific location

i have a file that looks like this:

000000112/01/2008 D99999
000000 12/01/2008 D99999
000000 12/01/2008 1D99999

i need to replace the blanks into 1 for column 7,18-19

how can this be achieved using awk?

Thanks.
# 2  
Old 07-19-2007
with the input sample you gave, what does the output look like?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing entire fields with specific text at end or beginning of field

Greetings. I've got a csv file with data along these lines: Spumoni's Pizza Place, Placemats n Things, Just Lamps Counterfeit Dollars by Vinnie, Just Shades, Dollar StoreI want to replace the entire comma-delimited field if it matches something ending in "Place" or beginning with "Dollar",... (2 Replies)
Discussion started by: palmfrond
2 Replies

2. Shell Programming and Scripting

Insert text line to specific location CSV

In Perl. ***edited question below*** Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file: age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
Discussion started by: whyte_rhyno
1 Replies

3. UNIX for Dummies Questions & Answers

Replacing all cells that have a specific value in a text file

I have a space delimited text file where I want to replace all cells that are 0 with NA. However I cannot simply use 'sed/0/NA/g' because there are other 0's in the text file that are part of numbers. Example input: 896.933464285715 0 874.691732142857 866.404660714286 Output:... (1 Reply)
Discussion started by: evelibertine
1 Replies

4. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

Hi, I have a text file in the following format: Code: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 ... (2 Replies)
Discussion started by: evelibertine
2 Replies

5. UNIX for Dummies Questions & Answers

Replacing a specific column of a text file with another column

I have a text file in the following format: 13412 NA06985 0 0 2 46.6432798439 4 4 4 4 13412 NA06991 NA06993 NA06985 2 48.8478948517 4 4 2 4 13412 NA06993 0 0 1 45.8022601455 4 4 2 4 13401 NA06994 0 0 1 48.780669145 4 4 4 4 13401 NA07000 0 0 2 47.7312017846 2 4 4 4 13402 NA07019... (3 Replies)
Discussion started by: evelibertine
3 Replies

6. Shell Programming and Scripting

Replacing text from multiple files at multiple location

Hi, I have many files scattered in all different folders. I want to replace the text within all the files using a single command ( awk, sed...) Is it possible? example find all the files in which there is text "memory" and replace it with "branded_memories". the files can be at the... (2 Replies)
Discussion started by: rudoraj
2 Replies

7. Shell Programming and Scripting

Find and replace a string a specific value in specific location in AIX

Hi, I have following samp.txt file in unix. samp.txt 01Roy2D3M000000 02Rad2D3M222222 . . . . 10Mik0A2M343443 Desired Output 01Roy2A3M000000 02Rad2A3M222222 . . (5 Replies)
Discussion started by: techmoris
5 Replies

8. Shell Programming and Scripting

Replacing text on specific columns 2nd

Hi , I'm so surprised to see my thread closed ! i come here many times and work with some great guys like Perderabo , each time i search for many solutions to write some scripts for my job , at this time i don't see how i can solve this one , so please don't take me as a pupil ! i can test... (16 Replies)
Discussion started by: Nicol
16 Replies

9. Shell Programming and Scripting

Replacing text on specific columns

Hi , i have one file like : APP101A APP103B MSG307A MSG308B XADM002A and so on , and i expect to replace the last character A by B and B by A the result would be : APP101B APP103A MSG307B MSG308A XADM002B how can i do that ? (3 Replies)
Discussion started by: Nicol
3 Replies

10. UNIX for Dummies Questions & Answers

Sed - Replacing numbers w/asteriks in random location in a file

I have a file which contains lots of text (comment field). I would like to parse through the comment field which can be up to 255 characters long and look for anything that seems to resemble, say, a credit card number or customer account number, etc. and replace the numbers with asteriks (*). ... (9 Replies)
Discussion started by: giannicello
9 Replies
Login or Register to Ask a Question