Sponsored Content
Full Discussion: Fixed length (Fill out)
Top Forums Shell Programming and Scripting Fixed length (Fill out) Post 44398 by peterk on Friday 5th of December 2003 11:05:02 AM
Old 12-05-2003
Fixed length (Fill out)

hello,

I have a file that has lines with different lengts. I want this file to be filled up with a zero so that al the lines have the same length.

Please advice?

File 1:
-----------
2310
2009
830
1345


Result
File 2:
----------
2310
2009
0830
1345
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

fixed record length

hello! I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \(\)_,\1_g' but it works only if there are spaces between... (16 Replies)
Discussion started by: george_
16 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

6. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

7. Shell Programming and Scripting

Fixed length fields

HPUX and posix shell Hi all. I have a record with fixed length fields....I would like to reorder the fields and preserver the fixed lengths.... cat test 4 960025460 Dept of Music 8 960025248 Dept of Music 12-08 cat... (3 Replies)
Discussion started by: lyoncc
3 Replies

8. 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

9. Shell Programming and Scripting

Make it to fixed length

Hi Team, I have a different length records in my text file.I would like to make all the records with same length. I want to check the maximum lenth and all other records make the same length It's urgent request. Thanks in Advance (2 Replies)
Discussion started by: Anthuvan
2 Replies

10. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
Algorithm::Dependency::Source::File(3pm)		User Contributed Perl Documentation		  Algorithm::Dependency::Source::File(3pm)

NAME
Algorithm::Dependency::Source::File - File source for dependency heirachys DESCRIPTION
Algorithm::Dependency::Source::File implements a source where the items are stored in a flat file or a relatively simple format. File Format The file should be an ordinary text file, consisting of a series of lines, with each line completely containing the information for a single item. Blank lines, or lines beginning with the hash character '#' will be ignored as comments. For a single item line, only word characters will be used. A 'word character' consists of all letters and numbers, and the underscore '_' character. Anything that is not a word character will be assumed to be a seperator. The first word will be used as the name or id of the item, and any further words in the line will be used as other items that this one depends on. For example, all of the following are legal. # A single item with no dependencies Foo # Another item that depends on the first one Bar Foo # Depending on multiple others Bin Foo Bar # We can use different seperators One:Two|Three-Four+Five=Six Seven # We can also use multiple non-word characters as seperators This&*&^*&File: is& & & :::REALLY()Neat From the examples above, it should be easy to create your own files. METHODS
This documents the methods differing from the ordinary Algorithm::Dependency::Source methods. new $filename When constructing a new Algorithm::Dependency::Source::File object, an argument should be provided of the name of the file to use. The constructor will check that the file exists, and is readable, returning "undef" otherwise. SUPPORT
To file a bug against this module, use the CPAN bug tracking system http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-Dependency <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Algorithm-Dependency> For other comments, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
Algorithm::Dependency COPYRIGHT
Copyright 2003 - 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.12.4 2009-04-14 Algorithm::Dependency::Source::File(3pm)
All times are GMT -4. The time now is 11:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy