09-16-2008
Pls help me with file editing using awk
Hi all,
Pls help me with file editing using awk.
I have a text file with the below format.
"STANDARD VOLUME ","2009","BUX","V","JCBH49","NF", 001413
"VENDOR MATERIAL-STD ","2009","BUX","V","JCBH49","NF", 009948
"INBOUND TRANS-STD ","2009","BUX","V","JCBH49","NF", 000264
"DIRECT LABOR-STD ","2009","BUX","V","JCBH49","NF", 000010
"VARIABLE BURDEN-STD ","2009","BUX","V","JCBH49","NF", 000062
"FIXED BURDEN-STD ","2009","BUX","V","JCBH49","NF", 000081
Here I want to retrieve the records of only "VENDOR MATERIAL-STD "and write to another text file. Also I want to replace "V" with “Prod Matl Cost PU Base Vehicle” and "O" with “Prod Matl Cost PU Avg Option” while writing to another file.
Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a file, say test.dat which is "|" separated. It has 50K records in it. One of the field in the file has the data in the format 'mm/dd/yyyy'. I need to edit the file by changing the format to 'yyyy/mm/dd' in the same field where as the rest of the data remain untouched. Please... (2 Replies)
Discussion started by: rinku11
2 Replies
2. Shell Programming and Scripting
I have input file that is having below text
098769
178902
234678
I want to modify the input file like below.
'098769',
'178902',
'234678'
Can you please help to get this. I tried but i am not getting this. (3 Replies)
Discussion started by: awk_beginner
3 Replies
3. Shell Programming and Scripting
Hello Awk Gurus,
Can anyone of you help me with the below problem. I have got a file having data in below format
pmFaultyTransportBlocks
-----------------------
9842993
pmFrmNoOfDiscRachFrames
-----------------------
NULL
pmNoRecRandomAccSuccess
-----------------------... (4 Replies)
Discussion started by: Mohammed
4 Replies
4. Shell Programming and Scripting
we have a file File1.I have used the below code to append 'file1' to each row.it is appending 'file1' but there is 5 empty space is coming after the end of each row.i found this opening in 'vi' mode and moving the cursor on each row ...can u help me ...
File1:
E100|0|05/29/1993|0|E001|E000... (3 Replies)
Discussion started by: satyam_sat
3 Replies
5. Shell Programming and Scripting
echo "23.54" | awk '
function round(A) {
return int( A + 0.5 )
}
{
printf("%d\n",round($1));
}'> > > > > >
awk: syntax error near line 2
awk: bailing out near line 2 (2 Replies)
Discussion started by: santosh1234
2 Replies
6. Shell Programming and Scripting
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies
7. Shell Programming and Scripting
hey i want to over write the fourth field of a ':' delimited file by first finding the required row by using grep.
i have done the following
cat file | grep no. | awk -F ':' { $4=count; print $1:$2:$3:$4;}
the correct values are being printed but nothin is bein added to the file..please... (5 Replies)
Discussion started by: dhe.arora
5 Replies
8. Shell Programming and Scripting
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies
9. Shell Programming and Scripting
Hello dear users, here I have a script to manipulate .csv files that are like this originally:
And I need to make a script to delete certain fields. Each field is separated with a comma.
So, here is my script (at least a part of it):
Field $1 is composed of a name, and then a... (5 Replies)
Discussion started by: sr00t
5 Replies
10. Shell Programming and Scripting
HI All,
I am new to unix. I have a file would like to do some editing by using awk, cut and sed. Could anyone help?
This file contain 100 lines. There are one line for example:
2,"102343454",5060,"579668","579668","579668","SIP",,,"825922","035885221283026",1,268,"00:59:00.782 APR 17... (2 Replies)
Discussion started by: mimilaw
2 Replies
LEARN ABOUT ULTRIX
regis_ps
ansi_ps(8) System Manager's Manual ansi_ps(8)
Name
ansi_ps, regis_ps, tek4014_ps - datatype to PostScript translators
Syntax
/usr/lib/lpdfilters/ansi_ps [ options ]
/usr/lib/lpdfilters/regis_ps [ options ]
/usr/lib/lpdfilters/tek4014_ps [ options ]
Description
Each translator reads from standard input and writes to standard output. If the data type is to be printed on a PostScript printer with
specialised support, the translator is invoked by using the script. Refer to
The command is the ANSI to PostScript translator.
The command is the Regis to PostScript translator.
The command is the Tektronix 4014 to PostScript translator.
The ANSI translator implements DEC-STD-074-0 (Printer System Reference Manual) and conforms to ISO/DSI 6429, ISO/DSI 2022, and ANSI X3.4
standards. Escape sequences (documented in the translator reference manual) that do not begin with DEC are taken from the ISO/DSI 6429,
ISO/DSI 2022 and ANSI X3.4 standards. Escape sequences that begin with DEC are legal extensions of DEC-STD-074-0. The ANSI translator
implements a few of the escape sequences documented in these standards.
The ANSI translator, requires a preamble to be present in the printer, and is designed to send this preamble to the printer. However, it
is quicker if the TCP/IP Supporting Host Software loads the preamble at boot time.
For instructions on what to do to enable the TCP/IP Supporting Host software to load the preamble when it boots, and to disable the trans-
lator from sending the preamble, see the Release Notes.
Options
The valid options for the translator are:
-e Interpret line feed as carriage return line feed. It is implemented by sending the control sequence string, to the translator before
reading standard input.
-Fpagesize
Select the size of the pages to be printed. The valid page sizes are: letter, a, ledger, b, legal, executive, a5, a4, a3, b5 or b4.
If the page size is not specified, a4 is used.
-Oorientation
Select the orientation of the text on the page. The valid orientations are: portrait or landscape. If the orientation is not speci-
fied, portrait is used.
-moutput_mode
Select the output mode of The output modes are:
8f Full 8-bit output
7f 7-bit output
8g GL/GR only
7g GL only
If the output mode is not specified, 8f is used.
-Rresource_string
Inform of a pre-loaded resource present in the PostScript environment of the printer. Multiple -R options may be passed.
-s Inhibit the final showpage. This allows more than one page to be printed on each sheet.
The valid options for the and translators are:
-Fpagesize
Select the size of the pages to be printed. The valid page sizes are: letter, a, ledger, b, legal, executive, a5, a4, a3, b5 or b4. If
the page size is not specified, a4 is used.
-Oorientation
Select the orientation of the text on the page. The valid orientations are: portrait or landscape. If the orientation is not speci-
fied, portrait is used.
-s Inhibit the final showpage. This allows more than one page to be printed on each sheet.
See Also
ln03rof(8), lpd(8), xlator_call(8)
ansi_ps(8)