add new rows in list of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting add new rows in list of files
# 1  
Old 02-02-2009
add new rows in list of files

Hi,
I Have a directory(views) and i have 100 .sql files in the same directory.
I need to be add 8 rows in each file.

The format 8 rows has like:
grant select on file_name to User1
/
grant select on file_name to User2
/
grant select on file_name to User3
/
grant select on file_name to User4
/
grant select on file_name to User5
/


Here file_name like input of .sql file.
# 2  
Old 02-02-2009
Add where, inside the file, appended at the end... more details needed. Also have a check at sed's \a (append) and \i (insert) maybe.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk- Indexing a list of numbers in file2 to print certain rows in file1

Hi Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1. For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)
Discussion started by: Geneanalyst
6 Replies

2. Shell Programming and Scripting

Convert rows to column and add header

Hi, I need help to convert rows in input file into a table. inputfile 192.98.1 192.98.192.98.17 VVC family Zorro 10 192.98.1 192.98.192.98.17 VVC family Ace 1 192.98.1 192.98.192.98.17 VVC family ... (4 Replies)
Discussion started by: redse171
4 Replies

3. UNIX for Dummies Questions & Answers

Matching the rows in 2 files

I have a file like this AFF3 BCL2 AGTRAP BRAF AHRR NCOA2 AKAP9 BRAF And second input file like this chromosome start end gene chr1 38177326 38664955 AFF3 chr4 148077060 148088064 AGTRAP chr13 74211117 74292309 AHRR chr5 3928185 ... (4 Replies)
Discussion started by: raj_k
4 Replies

4. UNIX Desktop Questions & Answers

merging files and add missing rows

hello all, I have files that have a specific way for naming the first column they are make of five names in Pattern of 3 Y = (no case sensitive) so the files are names $Y-$Y-$Y or $X-$Y-$Z depending how we look they only exist of the pattern exist now I want to create a file from them that... (9 Replies)
Discussion started by: A-V
9 Replies

5. UNIX for Dummies Questions & Answers

Add more than 65536 rows to Excel

i need to export data into a single excel file 2003 format using shell script which contains more than 65536 rows.. How this can be achieved? is it possible to move the datas to a new worksheet? (5 Replies)
Discussion started by: chn10db001
5 Replies

6. Shell Programming and Scripting

how to add if data in rows

Hi Friends, How to add if data is in different rows. Input: 1;20091102;20170930;-9.00;| 1;20091026;20170930;-2.00;| 1;20100720;20170930;-25.00;| 1;20090901;20211227;-10.00;| Output 9+2+25+10 = 46 Thx Suresh (4 Replies)
Discussion started by: suresh3566
4 Replies

7. Shell Programming and Scripting

Deleting specific rows in large files having rows greater than 100000

Hi Guys, I need help in modifying a large text file containing more than 1-2 lakh rows of data using unix commands. I am quite new to the unix language the text file contains data in a pipe delimited format sdfsdfs sdfsdfsd START_ROW sdfsd|sdfsdfsd|sdfsdfasdf|sdfsadf|sdfasdf... (9 Replies)
Discussion started by: manish2009
9 Replies

8. Shell Programming and Scripting

concatenate two files with different No of rows

need a shell which perform following function file 1 ( every time new data comes) 1212 2323 3434 4545 5656 . . . . file 2 (fixed line) update bc_tbl set aix=data , bix=back where cix=U and serial=; now when i execute shell it will concatinate file 1, file 2 & make file 3 as... (3 Replies)
Discussion started by: The_Archer
3 Replies

9. UNIX for Dummies Questions & Answers

Counting rows in many files

I'm regularly counting the number of rows in a number of files. I need to know how many rows their are in all files together. Counting rows in one file I can handle, but how do I count rows in all at once? I'd be grateful for any answer. (7 Replies)
Discussion started by: DrZoidberg
7 Replies

10. Shell Programming and Scripting

Concatenate rows in to 2 files

I have 2 files FILEA 1232342 1232342 2344767 4576823 2325642 FILEB 3472328 2347248 1237123 1232344 8787890 I want the output to go into a 3rd file and look like: FILEC 1232342 3472328 (1 Reply)
Discussion started by: unxusr123
1 Replies
Login or Register to Ask a Question