modify a few field of the record information


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting modify a few field of the record information
# 8  
Old 03-23-2007
Quote:
Originally Posted by happyv
$12 ~ /[0-9]/ { $12 = $12":00" }

the above statement is not work..if I split it to run and try the result
any errors? i am using GNU awk.
# 9  
Old 03-23-2007
Quote:
Originally Posted by ghostdog74
any errors? i am using GNU awk.
yes...somthing about between "/[0-9]/ { $12 " not correct.. and I use nawk
# 10  
Old 03-23-2007
Quote:
Originally Posted by happyv
yes...somthing about between "/[0-9]/ { $12 " not correct.. and I use nawk
might be different behaviours with nawk.sorry couldn't be of help. maybe someone with nawk can assist you later
# 11  
Old 03-23-2007
Quote:
Originally Posted by ghostdog74
might be different behaviours with nawk.sorry couldn't be of help. maybe someone with nawk can assist you later
no worry...anyway, thx your help and suggestion... Smilie
# 12  
Old 03-23-2007
Quote:
Originally Posted by happyv
yes...somthing about between "/[0-9]/ { $12 " not correct.. and I use nawk

Please be specific. Cut and paste the EXACT error message.

Also, post the script EXACTLY as you ran it (and show sample input). That line should work with any version of awk (old, pre-1988, awk, nawk, mawk, gawk, etc.).

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Prepend 0 to a field in a record

Hi All, I have a file like below. In the field 9 I am having 14,014,3,001/009 on the records. I want to convert the field to a three digit value. For example 14 should 014 , 3 should 003 11050;11001;;CREDITTRANC;5293218;NRATL;;;11095;;-1;14;3;29=0000;1.25... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

2. Shell Programming and Scripting

Display combination of 4 field uniqe record and along with concatenate 5th and 6th field.

Table ACN|NAME|CITY|CTY|NO1|NO2 115|AKKK|ASH|IND|10|15 115|AKKK|ASH|IND|20|20 115|AKKK|ASH|IND|30|35 115|AKKK|ASH|IND|30|35 112|ABC|FL|USA|15|15 112|ABC|FL|USA|25|20 112|ABC|FL|USA|25|45 i have written shell script using cut command and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies

3. Shell Programming and Scripting

awk repeat one field at all lines and modify field repetitions

Hello experts I have a file with paragraphs begining with a keeping date and ending with "END": 20120301 num num John num num A keepnum1 num num kathrin num num A keepnum1 num num kathrin num num B keepnum2 num num Pete num num A keepnum1 num num Jacob num... (2 Replies)
Discussion started by: phaethon
2 Replies

4. Shell Programming and Scripting

Get last field specific record

i have file A as below contents --------------------------- Use descriptive thread titles when posting. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". For example, do not post questions For example, do not deliminated. output file as below:... (2 Replies)
Discussion started by: ANSHUMAN1983
2 Replies

5. Shell Programming and Scripting

Modify record headers from file

Dear All I was wondering if anybody is able to help me with a script I am struggling with. I have to add comments to the "head-lines" (start with >) from an other file according to the ID tag. Only the head lines should be modified. cat File.txt >H1_A1_A2_A3_A4_ID1_A5 A:B:C:S:E:E:K... (4 Replies)
Discussion started by: loba
4 Replies

6. UNIX for Dummies Questions & Answers

Modify a record in a unix file

I have few records in a file and each file consists of a field for state and country of length 50 characters. Currently it being represented as Austin, Texas(remaining segments upto length 50 are blank) I need to modify this to Austin,Texas(remaining segments upto length 50 are blank) The... (3 Replies)
Discussion started by: jayumon
3 Replies

7. Shell Programming and Scripting

get a field from a record

I have a file as: A,B,C,D,E G,H,I,J,K I need to find if fourth field is blank or has a space and print that line to other file. I tried using awk but am not getting the desired result. Pls help. (6 Replies)
Discussion started by: praveenK_Dudala
6 Replies

8. Shell Programming and Scripting

how to replace field for each record

Hello, I have the following xml formatted file. I would like to get the newnumber field number and replace into customernumber for each record. For example: <XMLFORMAT> <customernumberR11>9</customernumberR11> ... (12 Replies)
Discussion started by: happyv
12 Replies

9. Shell Programming and Scripting

mapping record information

hi, I have a file called a.txt which contain some information (see below), I will like to check the mapping.txt and replace/add some information into a.txt a.txt CLIENT01,AUS,AUD CLIENT03,FRC,USD CLIENT02,JPN, CLIENT05,CHA,USD mapping.txt AUS AUD CHA USD FRC EUR JPN YEN a.txt... (2 Replies)
Discussion started by: happyv
2 Replies
Login or Register to Ask a Question