Sponsored Content
Top Forums Shell Programming and Scripting Concatenating fixed length lines in shell script Post 302515540 by kmanyam on Wednesday 20th of April 2011 10:44:38 AM
Old 04-20-2011
Concatenating fixed length lines in shell script

I have a peculiar file with record format like given below. Each line is wrapped to next lines after certain number of characters. I want to concatenate all wrapped lines into 1.

InputSmiliewrapped after 10 columns)
Code:
This is li
ne1
This is li
ne2 and 
this line
is too lo
ng
Shortline

Output:
Code:
This is line1
This is line2 and this line is too long
Shortline

Thanks for help.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 04-20-2011 at 11:49 AM.. Reason: code tags, please!
 

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 Length records- Korne Shell Program.

Hi, I need some help regarding in writing a Korne shell script, in determining the fixed length records in a data file. We have already utility in place, which does this work. The Code for this is as below. In the below $1 is the parameter passed to the script, which is the data file name. ... (4 Replies)
Discussion started by: nrajesh_2009
4 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. Shell Programming and Scripting

reading fixed length flat file and calling java code using shell scripting

I am new to shell scripting and I have to to the following I have a flat file with storename(lenth 20) , emailaddress(lenth 40), location(15). There is NO delimiters in that file. Like the following str00001.txt StoreName emailaddress location... (3 Replies)
Discussion started by: willywilly
3 Replies

5. Shell Programming and Scripting

Need awk script to compare 2 fields in fixed length file.

Need a script that manipulates a fixed length file that will compare 2 fields in that file and if they are equal write that line to a new file. i.e. If fields 87-93 = fields 119-125, then write the entire line to a new file. Do this for every line in the file. After we get only the fields... (1 Reply)
Discussion started by: Muga801
1 Replies

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

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

8. Shell Programming and Scripting

Deleting lines in a fixed length file where there is a word at specific location

I have a big file having 100 K lines. I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it. There are two lines as one Header and one trailer which should remain same. Can somebody... (5 Replies)
Discussion started by: mohit kanoongo
5 Replies

9. Shell Programming and Scripting

Fixed Length file from a SQL script

Hi, I have a DB2 UDB 9.7 SQL script, as follows: I need to pass the script into Unix and generate a fixed length file from this. Can someone kindly provide a script to achieve it? SELECT CAST(COALESCE(CL_ID,'000000000') AS CHAR(9)) AS CL_ID ,STATUS... (5 Replies)
Discussion started by: ebsus
5 Replies

10. Shell Programming and Scripting

Break one long string into multiple fixed length lines

This is actually a KSH under Unix System Services (Z/OS), but hoping I can get a standard AIX/KSH solution to work... I have a very large, single line file in Windows, that we download via FTP, with the "SITE WRAP" option, into a Z/OS file with an LRECL of 200. This essentially breaks the single... (4 Replies)
Discussion started by: bubbawuzhere
4 Replies
fntsample(1)						      General Commands Manual						      fntsample(1)

NAME
fntsample - PDF and PostScript font samples generator SYNOPSIS
fntsample [ OPTIONS ] -f FONT-FILE -o OUTPUT-FILE fntsample -h DESCRIPTION
fntsample program can be used to generate font samples that show Unicode coverage of the font and are similar in appearance to Unicode charts. Samples can be saved into PDF (default) or PostScript file. OPTIONS
fntsample supports the following options. --font-file, -f FONT-FILE Make samples of FONT-FILE. --font-index, -n IDX Font index for FONT-FILE specified using --font-file option. Useful for files that contain multiple fonts, like TrueType Collec- tions (.ttc). By default font with index 0 is used. --output-file, -o OUTPUT-FILE Write output to OUTPUT-FILE. --other-font-file, -d OTHER-FONT Compare FONT-FILE with OTHER-FONT. Glyphs added to FONT-FILE will be highlighted. --other-index, -m IDX Font index for OTHER-FONT specified using --other-font-file option. --postscript-output, -s Use PostScript format for output instead of PDF. --svg, -g Use SVG format for output. The generated document contains one page. Use range selection options to specify which. --print-outline, -l Print document outlines data to standard output. This data can be used to add outlines (aka bookmarks) to resulting PDF file with pdfoutline program. --include-range, -i RANGE Show characters in RANGE. --exclude-range, -x RANGE Do not show characters in RANGE. --style, -t "STYLE: VAL" Set STYLE to value VAL. Run fntsample with option --help to see list of styles and default values. --help, -h Display help text and exit. Parameter RANGE for -i and -x can be given as one integer or a pair of integers delimited by minus sign (-). Integers can be specified in decimal, hexadecimal (0x...) or octal (0...) format. One integer of a pair can be missing (-N can be used to specify all characters with codes less or equal to N, and N- for all characters with codes greather or equal to N). Multiple -i and -x options can be used. EXAMPLES
Make PDF samples for font.ttf and write them to file samples.pdf: fntsample -f font.ttf -o samples.pdf Make PDF samples for font.ttf, compare it with oldfont.ttf and highlight new glyphs. Write output to file samples.pdf: fntsample -f font.ttf -d oldfont.ttf -o samples.pdf Make PostScript samples for font.ttf and write output to file samples.ps. Show only glyphs for characters with codes less or equal to U+04FF but exclude U+0370-U+03FF: fntsample -f font.ttf -s -o samples.ps -i -0x04FF -x 0x0370-0x03FF Make PDF samples for font.ttf and save output to file samples.pdf adding outlines to it: fntsample -f font.ttf -o temp.pdf -l > outlines.txt pdfoutline temp.pdf outlines.txt samples.pdf AUTHOR
Copyright (C) 2007 Eugeniy Meshcheryakov <eugen@debian.org> Homepage: <http://fntsample.sourceforge.net/> SEE ALSO
pdfoutline(1) 2010-10-14 fntsample(1)
All times are GMT -4. The time now is 04:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy