Sponsored Content
Top Forums Shell Programming and Scripting Remove & insertion of data in a same file Post 302108667 by videsh77 on Wednesday 28th of February 2007 03:58:15 AM
Old 02-28-2007
Hi Anbu, with hardcoded filename it works fine. How to make it work with filename indicated by a variable?


Say at the place of file if wish to use $fname?

Thanks for your co-operation. I tried using -v option but then I am getting some awk error.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove Headers throughout a data file

I have a data file with over 500,000 records/lines that has the header throughout the file. SEQ_ID Name Start_Date Ins_date Add1 Add2 1 Harris 04/02/08 03/02/08 333 Main Suite 101 2 Smith 02/03/08 01/23/08 287 Jenkins SEQ_ID Name ... (3 Replies)
Discussion started by: psmall
3 Replies

2. UNIX for Dummies Questions & Answers

Search for & edit rows & columns in data file and pipe

Dear unix gurus, I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this: adam peter blah blah blah blah blah blah car 01 30 200 02 31 400 03 57 121 .. .. .. .. .. .. n y... (8 Replies)
Discussion started by: tintin72
8 Replies

3. Shell Programming and Scripting

Insertion in a file

Hi All, I want to insert a line just befor the lst line in a file. please can anyone advise. Cheers, Shazin (3 Replies)
Discussion started by: Shazin
3 Replies

4. Shell Programming and Scripting

Extract data from an XML file & write into a CSV file

Hi All, I am having an XML tag like: <detail sim_ser_no_1="898407109001000090" imsi_1="452070001000090"> <security>ADM1=????</security> <security>PIN1=????</security> <security>PIN2=????</security> ... (2 Replies)
Discussion started by: ss_ss
2 Replies

5. Shell Programming and Scripting

Remove 5th & 6th <td> from file

I have a page with a 6<td> structure. I need to strip the 5th and 6th <td></td> from the structure. The data in the 4th <td> varies, so I can't get a pattern on it. So, I tried setting up a count of the td occurrence and then remove the 5th and 6th, but I'm not making an progress. Is there an... (0 Replies)
Discussion started by: dba_frog
0 Replies

6. Shell Programming and Scripting

Remove 5th & 6th <td> from file

I have a page with a 6<td> structure. I need to strip the 5th and 6th <td></td> from the structure. The data in the 4th <td> varies, I can't get a pattern on it. So, I tried setting up a count of the td occurrence and then remove the 5th and 6th, but I'm not making any progress. Is there an easy,... (6 Replies)
Discussion started by: dba_frog
6 Replies

7. UNIX for Dummies Questions & Answers

Remove part of file name with sed & mv

Ok, so I have bunch of files that are named "orange__file_name.asm" and I want to batch rename them to "file_name.asm" I know that using "ls | sed s/orange__//" will get rid of the part of the file name I do not want. But how do I combine that with the mv command to actually do it? Thanks JG (5 Replies)
Discussion started by: john galt
5 Replies

8. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

9. Shell Programming and Scripting

Remove data from file

Hi I have file with filename as below and need to remove based on date in it. Data in file: filename_092013.csv filename_082013.csv filename_072013.csv I want to remove filenames which are generated 15 days back. where date is generated in file. I need to create another file with... (8 Replies)
Discussion started by: cnrj
8 Replies

10. UNIX for Beginners Questions & Answers

To remove any invisible and special characters from the file(exclude @!#$&*)

Hi Guys, My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$% abc|xyz|acd¥£ó adc|123| 12áí Please help on this. Thanks Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies
mailp(1)							   User Commands							  mailp(1)

NAME
mailp, digestp, filep, newsp, filofaxp, franklinp, timemanp, timesysp - frontends to the mp Text to PDL (Printer Description Language) pretty print filter SYNOPSIS
mailp [options] filename... newsp [options] filename... digestp [options] filename... filep [options] filename... filofaxp [options] filename... franklinp [options] filename... timemanp [options] filename... timesysp [options] filename... DESCRIPTION
The mailp utility is a frontend to the mp(1) program. It uses different names to provide various mp options: mailp Prints out mail messages. newsp Prints out USENET news articles. digestp Prints out USENET digest files. filep Prints out ordinary ASCII files. filofaxp Prints out in Filofax personal organiser format. franklinp Prints out in Franklin Planner personal organiser format. timemanp Prints out in Time Manager personal organiser format. timesysp Prints out in Time/System International personal organiser format. mailp and the associated programs read each filename in sequence and generate a prettified version of the contents. If no filename argu- ments are provided, mailp reads the standard input. mailp works in two ways. With the -D option, it will work as an X print server client to produce the PDL of the target printer and spool it. With the -d or -P option, it will generate and spool PostScripttm output. OPTIONS
The following options are supported: -d printer Sends output to the named printer. Otherwise, sends output to the printer named in the PRINTER environment variable. -D Generates the PDL for the target printer and spools it to the printer. -F Instead of printing who the mail article is for, the top header will contain who the mail article is from. This is a useful option for people with their own personal printer. -h Banner printing is disabled. Most of the information that typically appears on the banner sheet is output in the mp ban- ners. -l Formats output in landscape mode. Two pages of text will be printed per sheet of paper. -P printer Same as -d option. -s subject Uses subject as the new subject for the printout. If you are printing ordinary ASCII files which have been specified on the command line, the subject will default to the name of each of these files. OPERANDS
The following operand is supported: filename The name of the file to be read. ENVIRONMENT VARIABLES
If none of the -d, -D, or -P options is used, mailp uses the PRINTER environment variable to determine the printer to which the output from the mp(1)program is sent. If the PRINTER variable is not found, the default destination is the PostScripttm printer. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmp | +-----------------------------+-----------------------------+ SEE ALSO
mp(1), attributes(5) NOTES
The -P option, which spools the PDL directly to the target printer in mp(1), produces PostScripttm when used in mailp so as to be backward compatible. SunOS 5.10 30 Oct 2000 mailp(1)
All times are GMT -4. The time now is 12:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy