Visit Our UNIX and Linux User Community

Sed line concatenation problem

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sed line concatenation problem
# 8  
Old 11-11-2009
Ok Ok I figured out what was going on. This fixed the problem.
cat -v file.txt | tr -d '^M'

Thank you for your patience.

Previous Thread | Next Thread
Test Your Knowledge in Computers #681
Difficulty: Medium
In 2011, the Solaris 11 kernel source code was leaked to WikiLeaks.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

2. Shell Programming and Scripting

Line concatenation help

please help me on this.... cat /xx.txt 2:1 2 2:2 24 8:0 0 9:0 0 Expected result would be 2:1 2 2:2 24 8:0 0 9:0 0 (4 Replies)
Discussion started by: Aditya.Gurgaon
4 Replies

3. Shell Programming and Scripting

String variable concatenation through loop problem

Hi Team!! Please can anyone tell me why the following line does not work properly? str3+=$str2 it seems that str3 variable does not keep its value in order to be concatenated in the next iteration! Thus when i print the result of the line above it returns the str2 value What i want to do is to... (8 Replies)
Discussion started by: paladinaeon
8 Replies

4. Shell Programming and Scripting

String concatenation problem

Hi there, I'm writing a basic script where I want to make a string of 2 numeric fields from a file, which I have done, but the behavior is rather confusing. I have a file of random values such as: 1 2 3 4 5 6 7 8 9 10 and my awk code is: BEGIN { FS = " " } { str = str $1 $2 } END {... (7 Replies)
Discussion started by: HMChadwick
7 Replies

5. Shell Programming and Scripting

Concatenation of a line to previous line

I need to concatenate all lines of a file into 1 line. input file containing lines like 001123456400001234563 107 001578000000000000000000000000000000000000 0000000021600 001123456912345600003 107 001578000000000000000000000000000000000000 0000000992000 i am using command echo `awk... (6 Replies)
Discussion started by: reeta_shri
6 Replies

6. Shell Programming and Scripting

Another parsing line awk or sed problem

Hi, After looking on different forums, I'm still in trouble to parse a parameters line received in KSH. $* is equal to "/AAA:111 /BBB:222 /CCC:333 /DDD:444" I would like to parse it and be able to access anyone from his name in my KSH after. like echo myArray => display 111 ... (1 Reply)
Discussion started by: RickTrader
1 Replies

7. Shell Programming and Scripting

sed problem - last line of file deleted

Hi, I am simply trying to remove the header row from a file using sed, but I'm running into strange difficulties. It seems that in addition to removing the first line, this command is also removing the last line (or more specifically, clearing the last line, since the line is still counted... (4 Replies)
Discussion started by: erichpowell
4 Replies

8. Shell Programming and Scripting

SED - editing file names (End of line problem?)

For lists in sed, to say what to replace, is this correct: I am hoping that this would recognise that either a "." is present, or that the substitution happens at the end of the line. For files with extensions , my script works perfectly. My problem is, files without extentions, i.e. . ... (1 Reply)
Discussion started by: busillis
1 Replies

9. Shell Programming and Scripting

File concatenation problem

I have written a script to find particular text files created within the last 24 hours and concatenate them all into a single concat.txt file. The problem that I am running into is that the last line of the text files do not terminate with <CR><LF> characters (as do all the other lines in each... (3 Replies)
Discussion started by: jvander
3 Replies

10. UNIX for Dummies Questions & Answers

Sed new line problem

Hi all, I've searched the web and this forum for this but not had any luck. I'm trying to use sed so when it finds a space it will insert a new line. What i have is a file containing .e.g 1 2 4 7 9 and want it to look like 1 2 4 7 9 I've tried: more test2 | sed 's/ /\\n/g'... (1 Reply)
Discussion started by: Cordially
1 Replies
concat(1T)						       Tcl Built-In Commands							concat(1T)


concat - Join lists together SYNOPSIS
concat ?arg arg ...? _________________________________________________________________ DESCRIPTION
This command joins each of its arguments together with spaces after trimming leading and trailing white-space from each of them. If all the arguments are lists, this has the same effect as concatenating them into a single list. It permits any number of arguments; if no args are supplied, the result is an empty string. EXAMPLES
Although concat will concatenate lists (so the command: concat a b {c d e} {f {g h}} will return "a b c d e f {g h}" as its result), it will also concatenate things that are not lists, and hence the command: concat " a b {c " d " e} f" will return "a b {c d e} f" as its result. Note that the concatenation does not remove spaces from the middle of its arguments, so the command: concat "a b c" { d e f } will return "a b c d e f" (i.e. with three spaces between the a, the b and the c). SEE ALSO
append(1T), eval(1T) KEYWORDS
concatenate, join, lists ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on Tcl 8.3 concat(1T)

Featured Tech Videos