Generate 100 Character Fixed Length Empty File


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Generate 100 Character Fixed Length Empty File
# 8  
Old 02-03-2011
Typically when you're talking about empty blocks (aka sparse files) they are considered to contain char zero.

Also dd is going to scale much better, as I suspect printf won't work real well with "%1073741824s" if trying to create a 1Gb "empty" file.
# 9  
Old 02-03-2011
Files that are created containing the character zero are called dense files. Sparse files would be created like this:
Code:
dd if=/dev/zero of=sparsefile bs=1 count=0 seek=100

# 10  
Old 02-03-2011
Hi.

If the length of file is non-zero, then like cfajohnson I would not call it empty.

I have seen dense refer to file formats that might be compressed: Telephone tapping - Wikipedia, the free encyclopedia (search for dense).

The sparse file idea is different as noted by Scrutinizer: Sparse file - Wikipedia, the free encyclopedia

Words make a difference, and confusion can result if we don't understand the same concept embodied by a specific word ... cheers, drl
# 11  
Old 02-03-2011
Quote:
Originally Posted by drl
Hi.
[..]
I have seen dense refer to file formats that might be compressed: Telephone tapping - Wikipedia, the free encyclopedia (search for dense).
Here the word dense has a different meaning and I think it refers to a file that is dense, i.e. already compressed.

The term "dense file" is normally used as an antonym to "sparse file". In sparse files not every value is really stored. When these are referenced, they are given a default value, for example zero. In dense files every value is actually stored.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate fixed length txt file

hi, i am using below query to generate the fixed length txt file. this sql is being called from shell script. This is supposed to be a fixed record file with the below definitions. There must be 2 byte filler after the CAT_ID AND each line should have total of 270 bytes. field ... (1 Reply)
Discussion started by: itzkashi
1 Replies

2. Shell Programming and Scripting

Fixed length to delimited file conversion

Hi All, I need to convert a fixed length file to a delimited file with , (comma). But not all columns, some of the columns in the fixed files are used as fillers and I do not need that in the output file. test_fixed_len.txt I 0515 MR 394 I 0618 MR & MRS 942 I 0618 MR & MRS... (7 Replies)
Discussion started by: member2014
7 Replies

3. Shell Programming and Scripting

Replace and Increment a value in the fixed length file

Hi Everyone, I need to increment a value in the fixed length file. The file has almost a million rows. Is there any easy way to accomplish this. Ex input file ASDSD ADSD 00000 X AAASD ADSD 00000 X SDDDD ADSD 00000 X Ouput ASDSD ADSD 00001 X AAASD ADSD 00002 X SDDDD ADSD 00003 X ... (7 Replies)
Discussion started by: saratha14
7 Replies

4. UNIX for Dummies Questions & Answers

Length of a fixed width file

I have a fixed width file of length 53. when is try to get the lengh of the record of that file i get 2 different answers. awk '{print length;exit}' <File_name> The above code gives me length 50. wc -L <File_name> The above code gives me length 53. Please clarify on... (2 Replies)
Discussion started by: Amrutha24
2 Replies

5. Shell Programming and Scripting

how to read fixed length flat file....

Hi Gurus, Thanks in advance... I am new to writing shell scripting and help me out reading a flat file with fixed length. I have a fixed length flat file with storename(lenth 6) , emailaddress(lenth 15), location(10). There is NO delimiters in that file. Like the following str00001.txt... (2 Replies)
Discussion started by: willywilly
2 Replies

6. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

7. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

8. Shell Programming and Scripting

print a file with one column having fixed character length

Hi guys, I have tried to find a solution for this problem but couln't. If anyone of you have an Idea do help me. INPUT_FILE with three columns shown to be separated by - sign A5BNK723NVI - 1 - 294 A7QZM0VIT - 251 - 537 A7NU3411V - 245 - 527 I want an output file in which First column... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies

9. Shell Programming and Scripting

Manipulating a fixed length file w/o PERL

Greetings, I need to take a fixed length file, similar to the following: <input file> 1233 e 612 i 43378 f 03 x 22 17 e 9899 a 323e a6 z7 read in the character in position 6, and if that character = e, delete that line from the file. <output file> 43378 f 03 x 22 17 e 9899 ... (4 Replies)
Discussion started by: dabear
4 Replies

10. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies
Login or Register to Ask a Question