Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Mac OS X sed, add newline after pattern Post 302819773 by Scott on Tuesday 11th of June 2013 11:02:16 AM
Old 06-11-2013
It's still unclear if the input file contains only .dmg files.

Code:
$ xargs -n1 < file
1.dmg
2.dmg
3.dmg

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep and sed to find a pattern and add newline

Hello All, I have log file the result from a multithreaded process. So when a process finishes it will write to this log file as 123 rows merged. The issue is sometimes the processess finish at the same time or write to the file at the same time as 123 rows merged.145 rows merged. At... (5 Replies)
Discussion started by: ssikhar
5 Replies

2. Shell Programming and Scripting

grep the pattern followed by newline

Hi I have a problem using grep to find a pattern followed by newline. Here is my file xxxxxxxxxxxpattern patternxxxxxx pattern xxxpattern xxpatternx xxxxxxyyyyxxxx I want the result to be like this xxxxxxxxxxxpattern pattern xxxpattern Please help (2 Replies)
Discussion started by: lalelle
2 Replies

3. Shell Programming and Scripting

SED: how to remove newline after pattern?

Hi, I have the following XML not well-indented code: <hallo >this is a line </hallo> So I need to remove the newline. This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern: sed 's/<.*$/&/' How can I subtract the newline after my... (1 Reply)
Discussion started by: nico.ben
1 Replies

4. Shell Programming and Scripting

Sed: add text if pattern not found

Hello, I would like to add the line TIMEZONE="CET" if the pattern TIMEZONE is not found between the range <JOB and JOB> : Example: Src file: <!DOCTYPE DEFTABLE SYSTEM "deftable.dtd"> <DEFTABLE > <JOB TASKTYPE="Job" TIMEFROM="0030" TIMEZONE="CET" </JOB> <JOB... (5 Replies)
Discussion started by: mutunzi
5 Replies

5. Shell Programming and Scripting

Insert two newline after some pattern

Hi, I need to insert two newline characters after matching of a pattern in each line of a file. Eg. If i have a file with contents as follows:- Now, i want output as follows :- i.e., I need to insert two newline characters after the occurance of pattern "</Message>>". Thnx... (1 Reply)
Discussion started by: DTechBuddy
1 Replies

6. Shell Programming and Scripting

[Solved] Find duplicate and add pattern in sed/awk

<Update> I have the solution: sed 's/\{3\}/&;&;---;4/' The thread can be marked as solved! </Update> Hi There, I'm working on a script processing some data from a website into cvs format. There is only one final problem left I can't find a solution. I've processed my file... (0 Replies)
Discussion started by: lolworlds
0 Replies

7. Shell Programming and Scripting

Insert new pattern in newline after the nth occurrence of a line pattern - Bash in Ubuntu 12.04

Hi, I am getting crazy after days on looking at it: Bash in Ubuntu 12.04.1 I want to do this: pattern="system /path1/file1 file1" new_pattern=" data /path2/file2 file2" file to edit: data.db - I need to search in the file data.db for the nth occurrence of pattern - pattern must... (14 Replies)
Discussion started by: Phil3759
14 Replies

8. Shell Programming and Scripting

sed to add word if pattern exists

Hi, I have a file with data listed below: clm_id double, cnl_id double, cnl_amt double I want output to be clm_id string, cnl_id string, cnl_amt double So replace double by string if the field contains the word _id I tried sed -e 's/_id/& string/' filename The above will not... (2 Replies)
Discussion started by: wahi80
2 Replies

9. Shell Programming and Scripting

sed to remove newline chars based on pattern mis-match

Greetings Experts, I am in AIX; I have a file generated through awk after processing the input files. Now I need to replace or remove the new-line characters on all lines that doesn't have a ; which is the last character on the line. I tried to use sed 's/\n/ /g' After checking through the... (6 Replies)
Discussion started by: chill3chee
6 Replies

10. Shell Programming and Scripting

sed and awk to find pattern and add priffix

Original File Server1|poweredOn|268401| Server1/Server1.vmx|Red Hat Enterprise Linux 5 (64-bit) Need Output Server1|poweredOn|DR|T1|268401| Server1/Server1.vmx|Red Hat Enterprise Linux 5 (64-bit) Conduction to check find the string "SFCHT1" and "SR" and add prefix has... (4 Replies)
Discussion started by: ranjancom2000
4 Replies
ggv(1)								   User Commands							    ggv(1)

NAME
ggv - GNOME PostScript and PDF previewer SYNOPSIS
ggv [gnome-std-options] filename [filename2...] DESCRIPTION
GNOME Ghostview (ggv) is the GNOME PostScript viewer program. This PostScript viewer application is based on the (non-GNOME) GNU Ghostview application. ggv is a frontend for Ghostscript, an interpreter of PostScript that is able to properly render PostScript documents in a dis- play or a printer. ggv serves as a layer that isolates the user from the cumbersome options and interface of Ghostscript, and, at the same time, provides extra features such as panning and persistent user settings. One of the main features of ggv is its antialiasing functional- ity. The ggv user interface allows you to drag PostScript files into ggv, or to move the PostScript display by dragging the mouse in the pager window or the main window. ggv can display more than one document at a time. ggv provides transparent support for compressed Post- Script and PDF files. OPTIONS
The following options are supported: gnome-std-optionStandard options available for use with most GNOME applications. See gnome-std-options(5) for more information. OPERANDS
The following operands are supported: filename The name of the file to be previewed. One or more filenames may be specified on the command-line. ggv will create a sepa- rate window for each document. The specified file should be either a PostScript or PDF file. EXAMPLES
Example 1: Previewing the PostScript file "sample.ps" example% ggv sample.ps EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/ggv Executable for GNOME PostScript and PDF previewer ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-ps-viewer | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
GNOME Ghostview Manual Latest version of the GNOME Desktop User Guide for your platform. gs(1), gnome-std-options(5) NOTES
If you are unable to load a PostScript file, check the beginning of the file (uncompressed if necessary). The file might not be a Post- Script file, or it may have been created on a system that uses a different character for line ending than that used by UNIX (for example, an Apple Macintosh). The simplest solution for the latter is to write a small PERL script that converts the file into the correct format. Written by Brian Cameron (Sun Microsystems Inc., 2003), Jaka Mocnik (jaka.mocnik@kiss.uni-lj.si), Daniel M. German (dmg@csg.uwaterloo.ca), Jan Schaumann (jschauma@netmeister.org). SunOS 5.10 2 Oct 2003 ggv(1)
All times are GMT -4. The time now is 12:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy