awk: {gsub("\n"/,X,$0);print}
awk: ^ syntax error
awk: fatal: 0 is invalid as number of arguments for gsub
The error is pointing to the comma between / and X.
Quote:
Originally Posted by RavinderSingh13
Hello ngb,
AFSIK only GNU sed will take that \n substitution. Could you please try following and let me know if this helps.
You could first test awk command if that works successfully then you can try mv command to change tmp_Input_file to Input_file or if you want to change to a different file then you can change it accordingly. Also remove carriage characters if any in your file by doing tr -d '\r' < Input_file > Output_file.
dear all:
maybe i have a file like :
12
34
56
78
end
how do write can i replace newline into NA :
make the file inte :
12
NA
34
NA
56
78
END (3 Replies)
Hi all
I have the problem to substitute a string with newline in Perl. Can anybody help me?
And also how to replace a string with opening bracket (e.g. (START ) with a whitespace/null character?
Thanks in advance. (1 Reply)
I want to replace a text string with a newline. I have a long text file of random characters. I want to replace all the occurences of "pe" with a newline. How can I do that in Unix? There's a thread from 2004 saying that you can do something like this with sed by actually pressing the return... (1 Reply)
Hi, I'm very new to shell scripting and have searched google and this forum for quite some time now.
I have the following in my xml file:
<recipients>
<member>value1</member>
</recipients>
I need to find a string <recipients> that follows with a new-line and bunch of spaces and... (5 Replies)
Hi All,
I have the command in PERL for performing this, but Can you please suggest me how can i perform this using AWK:
My input xml file looks like this:
<aaa>hello</aaa><bbb>hai</bbb>
I want the output like this ( means need new line after end of each xml tag):
<aaa>hello</aaa>... (1 Reply)
Hi Guys,
I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same.
can anyone of you please let me know how to go about it ? (8 Replies)
Hi,
I'm struggling with a string replacement.
I have an XML file which is in the following layout
<FUNCTION>
<PRODUCTS>
<PRODUCT CODE="PRODUCE" ACTION="amend" VALIDATE="no">
<SUPPLIER PRODUCT="PRODUCT" ACTION="amend" CODE="SUPPLIER">
<STOCK_QUANTITY DATA="21"/>
... (15 Replies)
I have a string like below:
{\rtf1\fbidis\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fnil MS Sans Serif;}}
\viewkind4\uc1\pard\ltrpar\lang2057\f0\fs16 19/11/2010 SOME DESCRIPTION. \par
\lang1033\f1\par
}
I have to replace the newline character with null in the... (8 Replies)
Discussion started by: Pratik4891
8 Replies
LEARN ABOUT XFREE86
cr
cr(1) General Commands Manual cr(1)NAME
cr - converts text files between nix EOL and dos EOL
SYNOPSIS
cr - | + <input file> <output file>
DESCRIPTION
Text files, such as tle files, that come from a dos source usualy have the ^M symbol at the end of every line. Cr converts files between
the dos newline format and the normal *nix newline format by stripping the ^M to convert dos to *nix, using the '-' option, or adding ^M to
a *nix file to create the proper dos file when the '+' option is used.
Although this extra character is not often a problem, programs like seesat5, which are data driven will encounter parsing problems when the
extra character is present. It is these problems that cr is intended to repair.
Options
- | + One or the other of these options is required. The '-' option is used to remove ^M from all newlines found in the dos file. The '+'
option is used to add ^M to every newline found in a *nix file.
input file
Fully delineated path to the input file. As this program is used in the dos environment as well, standard input is not used.
output file
Fully delineated path to the output file. As this program is used in the dos environment as well, standart output is not used.
SEE ALSO seesat5(1), seesat5(7), SEESAT5.INI(5), tle(5)BUGS
Cr is not an inteligent program. It methodicaly replaces/removes the offending character when it finds it in the correct context. Newline
sequences found in contexts other than 'newline' will be replaced/removed just like those found in the proper context. Passing a binary
file through cr is not advised, for this reason. Send all inqueries to Dale Scheetz <dwarf@polaris.net>.
Debian Linux 2 April 96 cr(1)