Sponsored Content
Top Forums Shell Programming and Scripting Issue with a file that contains CRLF Post 302372929 by Scott on Thursday 19th of November 2009 05:09:07 AM
Old 11-19-2009
In your original code, try adding a space after %s:
Code:
printf ("%s " , $9) >>"filelist.dat"

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add CRLF is probably simple!

I am building a script that will execute programs using records/fields in a file as arguments. Before I start testing that, I am working on reading the file properly and using printf to display the fields in the file. I used typeset to format my output. Now all I need is to figure out how to... (1 Reply)
Discussion started by: Skyybugg
1 Replies

2. Programming

how to add CRLF support for CSV file generated in unix

Helo, my server side system is running on a redhat linux o.s. I have c program on the server which export list file into CSV format. now, I want that my program on server side is able to add support for CRLF(carriage return Line feed)into csv file format. so how do i write C program whcih... (3 Replies)
Discussion started by: amitpansuria
3 Replies

3. Web Development

CRLF to LF PHP

So I have this PHP script that takes info from HTML form and saves the info to a txt file. Here is the code <?php $input = $_POST; $dateposted = date("m-d-Y-His"); $fp = fopen("/some/location/public_html/sh/$dateposted.txt", "w"); fwrite($fp, $input.).'&nbsp;'; fclose($fp);... (16 Replies)
Discussion started by: GroveTuckey
16 Replies

4. Homework & Coursework Questions

Convert ASCII Text, with CRLF

1. The problem statement, all variables and given/known data: write a script asciiFix.sh that takes an arbitrary number of file paths from the command line and carries out the same analysis on each one. If a file is not Windows ASCII, your script should do nothing to it. For each file that is... (7 Replies)
Discussion started by: kwatt019
7 Replies

5. Shell Programming and Scripting

Appending CRLF to end of record

I need to append |\r\n (a pipe character and CRLF) at end of each record in Unix to all records where they are not already present. So first check for the presence of |\r\n and if absent append it else do nothing (3 Replies)
Discussion started by: abhilashnair
3 Replies

6. Shell Programming and Scripting

Sorting file with CRLF within field, RS=$

OK below is what my sample file looks like. I need to sort by the Primary Key ie: {1:F01SAESVAV0AXXX0466020126} in the first record. Record seperator is $. I tried sort, but it completely messes it up. I am thinking I will need to use something like awk which understands the record seperator... (6 Replies)
Discussion started by: alfredo123
6 Replies

7. Shell Programming and Scripting

Removing CRLF combo but not CR or LF when alone

What is the command or script to remove CRLF but only when joined? Tried using below but removed all instances of either cat a.txt | tr -d "\r\n" > b.txt (14 Replies)
Discussion started by: qqp
14 Replies

8. Shell Programming and Scripting

Replace CRLF between pipe (|) delimiter with LF

Hi Folks! Need a solution for the following :- Source data ------------- 123|123|<CRLF><CRLF><CRLF>|321<CRLF> Required output ------------------ 123|123|<LF><LF><LF>|321<CRLF> <CRLF> represents carriage return <LF> represents line feed Being hunting high and low for a... (10 Replies)
Discussion started by: hishamzz
10 Replies

9. UNIX for Beginners Questions & Answers

Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX?

My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data. ... (7 Replies)
Discussion started by: chandrath
7 Replies
Select(3)						User Contributed Perl Documentation						 Select(3)

NAME
podselect - function to extract selected sections of pod documentation SYNOPSIS
use PDL::Pod::Select; podselect (@filelist); podselect ({OUTPUT => "tmp.out"}, @filelist): podselect ({SELECT => ["NAME|SYNOPSIS", "OPTIONS"]}, @filelist): podselect ({OUTPUT => ">&STDERR", SELECT => ["DESCRIPTION"]}, "-"); DESCRIPTION
podselect() is a function which will extract specified sections of pod documentation from an input stream. This ability is already provided in the PDL::Pod::Parser module. Subclasses of PDL::Pod::Parser that wish to take advantage of this feature do not need to derive from PDL::Pod::Select. PDL::Pod::Select merely provides a single function named podselect() which provides this capability in function form (as opposed to object form) for extracting the raw pod docs. podselect(\%options, @filelist) podselect will print the raw (untranslated) pod documentation of all pod sections in the given input files specified by @filelist according to the given options. If any argument to podselect is a reference to a hash (associative array) then the values with the following keys are processed as follows: "OUTPUT" A string corresponding to the desired output file (or ">&STDOUT" or ">&STDERR"). The default is to use standard output. "SELECT" A reference to an array of sections specifications (as described in "SECTION SPECIFICATIONS" in PDL::Pod::Parser) which indicate the desired set of pod sections and subsections to be selected from input. If no section specifications are given, then all sections of pod documentation are used. All other arguments should correspond to the names of input files containing pod documentation. A file name of "-" or "<&STDIN" will be interpeted to mean standard input (which is the default if no filenames are given). SEE ALSO
PDL::Pod::Parser AUTHOR
Brad Appleton <Brad_Appleton-GBDA001@email.mot.com> Based on code for pod2text written by Tom Christiansen <tchrist@mox.perl.com> perl v5.12.1 2009-10-17 Select(3)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy