Sponsored Content
Full Discussion: Create multiple files
Top Forums Shell Programming and Scripting Create multiple files Post 302886319 by littlewenwen on Thursday 30th of January 2014 03:36:46 PM
Old 01-30-2014
Create multiple files

dear all

suppose I have two files file_000 and file_id:

file_000:
Code:
blablablabla000blablabla000
000blahblah000blahblah
blah000blahblah

file_id:
Code:
001
002
003

now, based on file_id, I want to create 3 files; the name of each file would be file_001,file_002,file_003,respectively, and the contents of each file would be identical to that of file_000, except all "000" would be replaced with file_id.

For example, file_001 would be:

file_001:
Code:
blablablabla001blablabla001
001blahblah001blahblah
blah001blahblah

My question is: what is the quickest way to make those 3 files? is it possible to just use a one-liner?

Thank you very much.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create multiple list of files in a directory ?

Hi, i have say 100 files in a directory. file1.log file2.log file3.log file4.log file5.log file6.log ... ... ... file99.log file100.log ========= I need to create another file which contains the list of al these log files. each file should contain only 10 log file names. it shud... (4 Replies)
Discussion started by: robinbannis
4 Replies

2. UNIX for Advanced & Expert Users

Create a file based on multiple files

Hey everyone. I am trying to figure out a way to create a file that will be renamed based off of one of multiple files. For example, if I have 3 files (cat.ctl, dog.ctl, and bird.ctl) that gets placed on to an ftp site I want to create a single file called new.cat.ctl, new.dog.ctl, etc for each... (3 Replies)
Discussion started by: coach5779
3 Replies

3. UNIX for Dummies Questions & Answers

can I create symbolic links for multiple files simultaneously

Does anybody know how to make symbolic links for multiple files simultaneously? Often times I need make symbolic links for multiple files with some common pattern (just like "*.jpg"). Is there a way to avoid making symbolic link for each of them one by one... Thank you! (6 Replies)
Discussion started by: danieladna
6 Replies

4. Shell Programming and Scripting

How to create multiple files?

HI, I would like to create the files as file1.txt file2.txt file3.txt ...... ....... ....... filen.txt in a single unix command, i dont want to use the loops. n is user specific Kindly help me in this. THank you Jagadeesh (2 Replies)
Discussion started by: jagguvarma
2 Replies

5. Shell Programming and Scripting

How to create multiple files from one file?

Hi everyone! I usually get large files with different groups of entries; for example, each line starts with A, B, C, D, or E. Is there a way to separate all these entries and then write them in 5 different files with one awk program? Thank you! (4 Replies)
Discussion started by: Avro1986
4 Replies

6. Shell Programming and Scripting

Create Multiple files with content

I have a file details.csv and I need to create 5 files in same folder named as details1.csv,details2.csv,details3.csv,details4.csv,details5.csv along with contents of details.csv Thanks in Advance. (9 Replies)
Discussion started by: Prashanth B
9 Replies

7. Shell Programming and Scripting

Create Multiple UNIX Files for Multiple SQL Rows output

Dear All, I am trying to write a Unix Script which fires a sql query. The output of the sql query gives multiple rows. Each row should be saved in a separate Unix File. The number of rows of sql output can be variable. I am able save all the rows in one file but in separate files. Any... (14 Replies)
Discussion started by: Rahul_Bhasin
14 Replies

8. Shell Programming and Scripting

Create multiple zip files each containing 50 xml files.

Hi, Is there a direct command or need to write a shell script for following requirement? Everyday a folder is populated with approx 25k to 30k xml files. I need to create multiple zip files in the same folder each containing 50 xml files. The last zip file may or may not contain 50 xml files.... (6 Replies)
Discussion started by: Rakesh Thobula
6 Replies

9. Shell Programming and Scripting

awk Parse And Create Multiple Files Based on Field Value

Hello: I am working parsing a large input file which will be broken down into multiples based on the second field in the file, in this case: STORE. The idea is to create each file with the corresponding store number, for example: Report_$STORENUM_$DATETIMESTAMP , and obtaining the... (7 Replies)
Discussion started by: ec012
7 Replies
VFS_FILEID(8)						    System Administration tools 					     VFS_FILEID(8)

NAME
vfs_fileid - Generates file_id structs with unique device id values for cluster setups SYNOPSIS
vfs objects = fileid DESCRIPTION
This VFS module is part of the samba(7) suite. Samba uses file_id structs to uniquely identify files for locking purpose. By default the file_id contains the device and inode number returned by the stat() system call. As the file_id is a unique identifier of a file, it must be the same on all nodes in a cluster setup. This module overloads the SMB_VFS_FILE_ID_CREATE() operation and generates the device number based on the configured algorithm (see the "fileid:algorithm" option). OPTIONS
fileid:algorithm = ALGORITHM Available algorithms are fsname and fsid. The default value is fsname. The fsname algorithm generates device id by hashing the kernel device name. The fsid algorithm generates the device id from the f_fsid returned from the statfs() syscall. fileid:mapping = ALGORITHM This option is the legacy version of the fileid:algorithm option, which was used in earlier versions of fileid mapping feature in custom Samba 3.0 versions. EXAMPLES
Usage of the fileid module with the fsid algorithm: [global] vfs objects = fileid fileid:algorithm = fsid VERSION
This man page is correct for version 3.2 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. Samba 4.0 06/17/2014 VFS_FILEID(8)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy