create file with 96 spaces


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers create file with 96 spaces
# 1  
Old 04-07-2006
create file with 96 spaces

hi,

strange requirement but what to do:-(....

i need to create a file with a record length of 96 and entirely with spaces...
i thought of using sed (like sed G etc...) but no success...

wud be glad if some one help:-)...

Regards,
Bhups
# 2  
Old 04-07-2006
Try...
Code:
printf '%96s' ' ' > file1

# 3  
Old 04-07-2006
Code:
dd if=/dev/zero seek=0 bs=96 count=1 | tr '\000' '\040' > empty.file

# 4  
Old 04-07-2006
Quote:
Originally Posted by Ygor
Try...
Code:
printf '%96s' ' ' > file1

Ah ! So sweet !! Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove spaces in a file

Hi friends, I have a file1.txt 1 | a | 4757634 | jund jdkj | erhyj 2 | a | 4757634 | jnd jdkj | rhje hjrhwj i have used tr -d '\040' to remove the spcaes output file cat file1.txt | tr -d '\040' 1|a|4757634|jundjdkj|erhyj... (5 Replies)
Discussion started by: i150371485
5 Replies

2. Linux

How to remove spaces in the file?

hiii i have a file that contains spaces in the begining of a file till the middle the from there the txt would appear. hw can i remove those spaces and bring the text to the begining portion file1 text starts from here (12 Replies)
Discussion started by: anurupa777
12 Replies

3. Shell Programming and Scripting

Conversion of spaces Text file into CSV format file

Input file (each line is separaed by spaces )given below: Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies

4. Shell Programming and Scripting

File Name with spaces

I need to read pdf files copied in a unix directory.I tried using the for loop with find command but the file names is cutting off at the spaces.Below is the code I tried. for FILENAME in `find $DIR_FILE/ -name "*.pdf" -mindepth 1 -maxdepth 1 -mmin +60 ` ##Needs to be changed later +60 to -60 do... (4 Replies)
Discussion started by: Beena
4 Replies

5. UNIX for Dummies Questions & Answers

cleaning up spaces from fixed width file while converting to csv file

Open to a sed/awk/or perl alternative so that i can stick command into my bash script. This is a problem I resolve using a combination of cut commands - but that is getting convoluted. So would really appreciate it if someone could provide a better solution which basically replaces all... (3 Replies)
Discussion started by: svn
3 Replies

6. UNIX for Dummies Questions & Answers

how to replace spaces with '_' in a file?

Hello #I have a file with a list of sequences; the sequence name is the line starting with '>'. $cat infile >AluYa5 SINE1/7SL Homo sapiens ggccgggcgcggtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacgaggtc aggagatcgagaccatcccggctaaaacggtgaaaccccgtctctactaaaaatacaaaaaattagccgg... (11 Replies)
Discussion started by: jdhahbi
11 Replies

7. Shell Programming and Scripting

Removing blank spaces, tab spaces from file

Hello All, I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out. My file is like this (<b> means one blank space, <t> means one tab space)- $ cat file NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies

8. UNIX for Dummies Questions & Answers

how to append spaces(say 10 spaces) at the end of each line based on the length of th

Hi, I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is. I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies

9. Shell Programming and Scripting

File names with spaces? Is it possible?

Gurus - I got one simple TXT file with long file name with blank spaces in between the words. I am trying to display that full file name, but it breaks while displaying. Could somebody shed some light here? Script ------ for i in `cat ~\temp\employee.txt` do echo $i done (5 Replies)
Discussion started by: Eric_2005
5 Replies

10. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies
Login or Register to Ask a Question