Sponsored Content
Top Forums Shell Programming and Scripting replacing certain characters with new line? Post 302117362 by radoulov on Sunday 13th of May 2007 04:34:01 PM
Old 05-13-2007
With GNU Awk:

Code:
awk '$1=$1' RS="[\n/,-]" inputfile

Otherwise:

Code:
sed 's/ *[/,-] */\
/g' inputfile

Then use sort to order the output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing all but last Hex characters in a text line

I must remove hex characters 0A and 0D from several fields within an MS Access Table. Since I don't think it can be done in Access, I am trying here. I am exporting a Table from Access (must be fixed length fields, I think, for my idea to work here) into a text format. I then want to run a... (2 Replies)
Discussion started by: BAH
2 Replies

2. Shell Programming and Scripting

Replacing characters in file with line break

Hi, Apologies if this has been asked before, but I searched and was not able to find an answer. It's probably a simple question to answer for those of you with some experience, though... I have a relatively long string where tokens are separated by the colon (':') character. Let's say the... (10 Replies)
Discussion started by: johnemb
10 Replies

3. UNIX for Dummies Questions & Answers

replacing characters

Hi, I have a script for replacing bad characters in filenames for f in *; do mv $f `echo $f | tr '+' '_'` done; this replaces + for _ But I need to replace all bad characters ? / % + to _ Pls how can i do this in one script ? (3 Replies)
Discussion started by: palmer18
3 Replies

4. Shell Programming and Scripting

replacing characters

hi all I have a file that has sone spaces in start then / at last. i want to get rid of this. how to do? eg. 11414/ 49878/ 27627/ I WANT THE FILE AS 11414 49878 27627 PLEASE HELP (3 Replies)
Discussion started by: infyanurag
3 Replies

5. Shell Programming and Scripting

Replacing Characters

Hi All, I have a file which is delimeted with the character '. i need to replace this character with the same character and also a new line. Can anyone please help me with the tr command for this. Many thanks Karan (11 Replies)
Discussion started by: karansachdeva
11 Replies

6. Shell Programming and Scripting

Replacing Characters with |

Hi All, example data.log 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 526569346 66815531961 09 I want like this to 526569346|66815531961|09 526569346|66815531961|09... (4 Replies)
Discussion started by: ooilinlove
4 Replies

7. Shell Programming and Scripting

Replacing strang characters ^Y ^Z ^Q ^A

hello frends, i am facing a problem where when i use vi to ciew my files then every line contains a special character like ^Q ^A ^Y ^Z in the very beginning. i tried to remove them using many techniques already posted in this forum but in vain. please take a sample of file when viewed in vi editor:... (6 Replies)
Discussion started by: vikas_kesarwani
6 Replies

8. Shell Programming and Scripting

Replacing characters

Hi fellow experts, I have a question for you. Data looks like: 00877,05/13/2010,PBO,P,0000708331,518 00877,05/13/2010,PBO,P,0000708331,519 ... ... 00877,05/13/2010,PBO,P,0000708331,2103 00877,05/13/2010,PBO,P,0000708331,2104,etc,etc Basically I have to replace 518,519,2103,2104,... (4 Replies)
Discussion started by: Devski123
4 Replies

9. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

10. Shell Programming and Scripting

Replacing end of line characters

Hello, I'm looking for some help in renaming data-timestamps stored within different calendar directories/files. The calendar directory has hundreds of ICS files: ~/Library/Calendars/F494C908.calendar/Events/92B65E439AAC.ics ~/Library/Calendars/F494C908.calendar/Events/DE7867E61969.ics... (8 Replies)
Discussion started by: Schubi
8 Replies
PSWRAP(1)						      General Commands Manual							 PSWRAP(1)

NAME
pswrap - creates C procedures from segments of PostScript language code SYNOPSIS
pswrap [ -apr ] [ -o outputCfile ] [ -h outputHfile ] [ -s maxstring ] inputfile DESCRIPTION
pswrap reads input from inputfile and creates C-callable procedures, known as wraps, that send PostScript language code to the PostScript interpreter. inputfile contains segments of PostScript language code wrapped with a C-like procedure syntax. Wraps are the most efficient way for an application to communicate with the PostScript interpreter. For complete documentation of pswrap and the language it accepts, see "pswrap Reference Manual" in Programming the Display PostScript System with X. OPTIONS
inputfile A file that contains one or more wrap definitions. pswrap transforms the definitions in inputfile into C procedures. If no input file is specified, the standard input (which can be redirected from a file or pipe) is used. The input file can include text other than wrap definitions. pswrap converts wrap definitions to C procedures and passes the other text through unchanged. Therefore, it is possible to intersperse C-language source code with wrap definitions in the input file. Note: Although C code is allowed in a pswrap input file, it is not allowed within a wrap body. In particular, no CPP macros (for example, #define) are allowed inside a wrap. -a Generates ANSI C procedure prototypes for procedure definitions in outputCfile and, optionally, outputHfile. The -a option allows compilers that recognize the ANSI C standard to do more complete type checking of parameters. The -a option also causes pswrap to generate const declarations. Note: ANSI C procedure prototype syntax is not recognized by most non-ANSI C compilers, including many compilers based on the Porta- ble C Compiler. Use the -a option only in conjunction with a compiler that conforms to the ANSI C Standard. -h outputHFile Generates a header file that contains extern declarations for non-static wraps. This file can be used in #include statements in mod- ules that use wraps. If the -a option is specified, the declarations in the header file are ANSI C procedure prototypes. If the -h option is omitted, a header file is not produced. -o outputCFile Specifies the file to which the generated wraps and passed-through text are written. If omitted, the standard output is used. If the -a option is also specified, the procedure definitions generated by pswrap are in ANSI C procedure prototype syntax. -p Specifies that strings passed by wraps are padded so that each data object begins on a long-word (4-byte) boundary. This option allows wraps to run on architectures that restrict data alignment to 4-byte boundaries and improves performance on some other archi- tectures. -r Generates reentrant code for wraps shared by more than one process (as in shared libraries). Reentrant code can be called recur- sively or by more than one thread. The -r option causes pswrap to generate extra code, so use it only when necessary. -s maxstring Sets the maximum allowable length of a PostScript string object or hexadecimal string object in the wrap body input. A syntax error is reported if a string is not terminated with ) or > within maxstring characters. maxstring cannot be set lower than 80; the default is 200. SEE ALSO
Programming the Display PostScript System with X (Addison-Wesley Publishing Company, Inc., 1993). AUTHOR
Adobe Systems Incorporated NOTES
PostScript and Display PostScript are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Copyright (c) 1988-1994 Adobe Systems Incorporated. All rights reserved. Adobe Systems 4 Apr 1994 PSWRAP(1)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy