10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a data file with new lines.
How to remove the newlines and should be showed in one line.
I tried using the command
tr -d '\n' filename
sed 's/\n//g' file name
Ex: 1 abc hyd is actual record
but in our scenario showing it as
hydthis record should be like... (5 Replies)
Discussion started by: victory
2. Shell Programming and Scripting
Hi All -
I am in need of some help in formating the below file
1) replace newlines with space
2) replace '#~# ' with newline
sample inputfile a
I|tya1|tya2|dfg|sfd|aaa#~#... (5 Replies)
Discussion started by: J1nx007
3. UNIX for Dummies Questions & Answers
my file are like this:
but i want
any command or Shell script for this.
please help me it's urgent to implement (33 Replies)
Discussion started by: Suneelbabu.etl
4. Shell Programming and Scripting
i have a requirement to replace a string with another using sed and to get the result newline separated but after sed replacement the newline vanishes
below is sample code
string="name sam\nage 45 \nsport soccer"
string=`echo $string | sed... (2 Replies)
Discussion started by: midhun19
5. Shell Programming and Scripting
I need some help with getting rid of newlines with the output from a MYSQL query and putting the information into the right format that I need.
Here is the script as it is today:
my $uda = system("/opt/incontrol/mysql/bin/mysql -u root -ppassword... (2 Replies)
Discussion started by: brianjb
6. Shell Programming and Scripting
My file looks like this:
1 2 3
3 4 5
6 7 8
8 7 6
3 4 5
3 6 7
3 4 5
1 2 4
3 4 6
2 4 6
As you can see there are two newlines after the next pattern of numbers begin. (4 Replies)
Discussion started by: shoaibjameel123
deleteing post (0 Replies)
Discussion started by: dshakey
8. Shell Programming and Scripting
Hello, there. I have a file that's a horrible, horrible mess. (Basically, it's an export from a firewall config.) The people who generated the file didn't think that putting a newline in the middle of a hostname would ever be a problem. It is.
Here's an example of the stuff in the file:
... (2 Replies)
Discussion started by: mikesimone
9. Shell Programming and Scripting
Since the previous time I received help from unix.com I have been encouraged to learn more.
going through 1 of the articles(View Article) on sed I found, it pointed an interesting situation.
Suppose the text is :
Romeo and Ethel the Dancer Moves Audience to Tears.
I... (3 Replies)
Discussion started by: hkansal
10. Shell Programming and Scripting
silly question that I'm sure is easy to answer for a more experienced coder...
I have a file called test.txt containing the following text...
need, to, break, this, line, into, individual, lines
using sed, I'd like to make the file look like this...
line... (5 Replies)
Discussion started by: newbie_coder
NM(1) General Commands Manual NM(1)
nm - print name list (2BSD)
nm [ -gnopru ] [ file ... ]
Nm prints the name list (symbol table) of each object file in the argument list. If an argument is an archive, a listing for each object
file in the archive will be produced. If no file is given, the symbols in "a.out" are listed.
Each symbol name is preceded by its value (blanks if undefined) and one of the letters U (undefined), A (absolute), T (text segment sym-
bol), D (data segment symbol), B (bss segment symbol), C (common symbol), or f file name. If the symbol is local (non-external) the type
letter is in lower case. If the file is an overlaid executable, the overlay number is printed after the name. The number is printed if
the symbol is in an overlay or if it is the entry point (in the base segment) for a subroutine in an overlay. The output is sorted alpha-
-g Print only global (external) symbols.
-n Sort numerically rather than alphabetically.
-o Prepend file or archive element name to each output line rather than only once.
-p Don't sort; print in symbol-table order.
-r Sort in reverse order.
-u Print only undefined symbols.
ar(1), ar(5), a.out(5), stab(5)
3rd Berkeley Distribution April 29, 1985 NM(1)