Sponsored Content
Top Forums Shell Programming and Scripting Removing CRLF combo but not CR or LF when alone Post 302993585 by qqp on Saturday 11th of March 2017 01:12:45 PM
Old 03-11-2017
needs to be automated as its becoming a daily import to our db.


Simply put, I want to leave the LF marks untouched.... and remove all CRLF when CRLF are found together


thanks all
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Modem/Sound combo

I just got yet another PI! yay! :D . one problem... the sound/modem card is not detected by the kernel or even by windows PnP! i dunno of any UNIX driverDB online, but if you could point me to one, it would be fantastic! (4 Replies)
Discussion started by: boris888
4 Replies

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

3. Shell Programming and Scripting

grep, awk, nawk combo

I have 2 files: File1 "aa","server","001-9031234-001", File2 001-9031234-001|12345 Both files have many lines of text. Each line needs to be evaluated. I need to look at the value of the third field in File 1. Then look for that same value in File 2 and assign the value of Field 2... (5 Replies)
Discussion started by: scriptr2be
5 Replies

4. Shell Programming and Scripting

Issue with a file that contains CRLF

I have a nawk that reads in a log file and outputs a file that matches my search. IFS=" " while read record do `echo $record | nawk 'BEGIN { FS=" " } { type_record=substr($0, 1, 1); if (... (14 Replies)
Discussion started by: Pablo_beezo
14 Replies

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

6. Shell Programming and Scripting

Combo for text

Hello all, i need to extract a part from an API output. Imagine this is the output : "result": "result": i need to use only the "hello my name is Mike" in the second line, without " " how can i do that? Thanks in advance Kind Regards and congrats for the great forum. (2 Replies)
Discussion started by: Board27
2 Replies
SM(1)							    InterNetNews Documentation							     SM(1)

NAME
sm - Command-line interface to the INN storage manager SYNOPSIS
sm [-cdHiqRrSs] [token ...] DESCRIPTION
The INN storage manager is the subsystem that stores and keeps track of all of the articles and what storage backend they're in. All stored articles are assigned a storage API token. sm is a command-line interface to that storage manager, primarily used to retrieve articles by those tokens but also to perform other operations on the storage subsystem. token is the token of an article (the same thing that's returned by grephistory or stored in the history file). It looks something like: @0502000005A4000000010000000000000000@ Any number of tokens can be given on the command-line for any function other than -s. If none are, sm normally reads tokens from standard input, one per line. The default operation is to retrieve and write to standard output the corresponding article for each token given. If -s is given, sm instead stores the article given on standard input (in native format, not wire format) using the standard rules of the storage subsystem. If the article is stored successfully, the token of the article is printed to standard output. Please note that this does not make any attempt to write a history entry or any overview data, and is therefore only useful under very specific circumstances. OPTIONS
-c Show a clear, decoded form of the storage API token. Each part of the token is explained, in a human-readable string. Amongst other elements, this command gives the path to where the corresponding article is supposed to be stored. -d, -r Rather than retrieving the specified article, remove the article. This will delete the article out of the news spool and it will not subsequently be retrievable by any part of INN. It's equivalent to "ctlinnd cancel" except it takes a storage API token instead of a message-ID. -H Retrieve only the headers of the article rather than the entire article. This option cannot be used with -d, -r, -i, or -S. -i Show the newsgroup name and article number associated with the token rather than the article itself. Note that for crossposted articles, only the first newsgroup and article number to which the article is associated will be returned. -q Suppress all error messages except usage errors. -R Display the raw article. This means that line endings won't be converted to native line endings and will be left as CRLF sequences; leading periods will still be escaped for sending over NNTP, and the article will end in a CRLF.CRLF sequence. -S Write the article to standard output in the format used by rnews spool files. Multiple articles can be written in this format, and the resulting output can be fed to rnews (on another system, for example) to inject those articles into INN. This option cannot be used with -d, -r, -H, -i, or -R. -s Store the article given on standard input using the normal storage rules for articles as configured in storage.conf(5). Print the new token for the message to standard output if it is stored successfully. If this option is given, no other options except possibly -q should be given. EXIT STATUS
If all operations were successful, sm exits with status 0. If an operation on any of the provided tokens fails, sm will exit with status 1, even if the operations on other tokens were successful. In other words, if twenty tokens are fed to "sm -r" on stdin, 19 articles were successfully removed, but the sixth article couldn't be found, sm will still exit with status 1. This means that if you need to be sure whether a particular operation succeeded, you should run sm on one token at a time. HISTORY
Written by Katsuhiro Kondou <kondou@nec.co.jp> for InterNetNews. Rewritten in POD by Russ Allbery <rra@stanford.edu>. $Id: sm.pod 8818 2009-11-17 18:58:24Z iulius $ SEE ALSO
ctlinnd(8), grephistory(1), history(5), rnews(1), storage.conf(5). INN 2.5.3 2010-02-08 SM(1)
All times are GMT -4. The time now is 03:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy