Sponsored Content
Top Forums Shell Programming and Scripting Echo printing a line in 2 lines; expected to print in one line Post 302927280 by linuxUser_ on Monday 1st of December 2014 10:55:49 PM
Old 12-01-2014
Echo printing a line in 2 lines; expected to print in one line

Dear All,

fileName: therm.txt
Code:
nc3h7o2h   7/27/98 thermc   3h   8o   2    0g   300.000  5000.000 1390.000    41 
 1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14    2 
-2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05    3 
 7.98979513e-09-9.39626069e-13-2.54265832e+04 1.79683851e+01                   4 
nc3h7o2    7/27/98 thermc   3h   7o   2    0g   300.000  5000.000 1387.000    31 
 1.23635662e+01 1.69377420e-02-5.80705297e-06 9.02805946e-10-5.24229836e-14    2 
-1.19482794e+04-3.57854035e+01 3.15306348e+00 3.52691052e-02-1.90649122e-05    3 
 5.01988372e-09-5.10606304e-13-8.35295454e+03 1.49406763e+01                   4 
c3h6ooh1-3 7/27/98 thermc   3h   7o   2    0g   300.000  5000.000 1388.000    41 
 1.45796713e+01 1.48373142e-02-5.13088443e-06 8.02513899e-10-4.68026484e-14    2 
-5.08733997e+03-4.60293044e+01 3.02841453e+00 3.90930362e-02-2.35990175e-05    3 
 6.75244193e-09-7.05929372e-13-7.99302348e+02 1.69822279e+01                   4 
c3h6ooh1-2 7/27/98 thermc   3h   7o   2    0g   300.000  5000.000 1381.000    41 
 1.43342402e+01 1.50496617e-02-5.20515993e-06 8.14227552e-10-4.74899437e-14    2 
-6.33723421e+03-4.47976591e+01 4.08359443e+00 3.40422329e-02-1.62692689e-05    3 
 2.38765400e-09 2.21650818e-13-2.27965073e+03 1.20159683e+01                   4

sedFile.sh
Code:
sed -i 's/"c3h6ooh1-2"/"LONG0001 "/g' therm.txt

What I am trying to do is simple sed operartion to replace text "c3h6ooh1-2" with "LONG0001". Strangely it is not happening.

Can somebody have a look where I am doing wrong?

Thanks & Regards,
linuxUser_
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

2. Shell Programming and Scripting

Print (echo) variable in a single line

Hi, I have written this code ------------------------------------------------ # !/bin/ksh i=0 while do j=$i while do echo -e $j #printf "%d",$j j=`expr $j - 1` done echo i=`expr $i + 1` done ---------------------------------------------------- The ouput which... (2 Replies)
Discussion started by: rac
2 Replies

3. Shell Programming and Scripting

print - for printing whole line, but delimeters are changed to spaces

Hi consider the source file R|field1|field2 using the print statement in awk prints it as R field1 field2 Is there an easier way to print the whole line in its original format (i.e. with | delimiters) than doing print $1"|"$2"|"$3 ?? Thanks Storms (1 Reply)
Discussion started by: Storms
1 Replies

4. Shell Programming and Scripting

String search and print next all lines in one line until blank line

Dear all I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under. i/p file: A1/EXT "BSCABD1_21233G1" 757 130823 1157 RADIO X-CEIVER ADMINISTRATION BTS EXTERNAL FAULT ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

5. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

6. Shell Programming and Scripting

Printing multiple lines on the same line between specific text

This is an extract from a large file. The lines that start with fc are ports on a fabric switch. In between each fc port there is information about the port. fc2/12 is up Port description is SEIEDISCOVER-3 Speed is 4 Gbps fc2/13 is down (Administratively down) fc2/14 is up Port... (1 Reply)
Discussion started by: kieranfoley
1 Replies

7. Shell Programming and Scripting

Grep echo awk print all output on one line

Hello, I've been trying to find the answer to this with Google and trying to browse the forums, but I haven't been able to come up with anything. If this has already been answered, please link me to the thread as I can't find it. I've been asked to write a script that pulls a list of our CPE... (51 Replies)
Discussion started by: rwalker
51 Replies

8. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies

9. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies

10. Shell Programming and Scripting

Echo print on same line while loop using variable

Currently using below script but echo it print the output in two line. Input file all-vm-final-2.txt CEALA08893 SDDC_SCUN DS_SIO_Workload_SAPUI_UAT_01 4 CEALA09546 SDDC_SCUN DS-SIO-PD5_Workload_UAT_SP1_Flash_07 4 CEALA09702 SDDC_SCUN DS-VSAN-RMP-WORKLOAD01 4 DEALA08762 SDDC_LDC... (3 Replies)
Discussion started by: ranjancom2000
3 Replies
CFDISK(8)							 GNU cfdisk Manual							 CFDISK(8)

NAME
GNU cfdisk - a curses-based partition table manipulation program SYNOPSIS
cfdisk [options] [device] DESCRIPTION
cfdisk is a disk partition manipulation program, which allows you to create, destroy, resize, move and copy partitions on a hard drive using a simple menu-driven interface. It is useful for organising the disk space on a new drive, reorganising an old drive, creating space for new operating systems, and copying data to new hard disks. For a list of the supported partition types, see the --list-partition-types option below. OPTIONS
-h, --help displays a help message. -v, --version displays the program's version. -a, --arrow-cursor use an arrow cursor, instead of reverse video highlighting, in case your terminal doesn't support it. -z, --new-table create a new partition table on the disk. This is useful if you want to change the partition table type or want to repartition you entire drive. Note that this does not delete the old table on the disk until you commit the changes. -u, --units=UNIT sets the default display units to UNIT. A list of possible units is given below. -t, --list-partition-types displays a list of supported partition types and features. UNITS
You can choose in what unit cfdisk should display quantities like partition sizes. You can choose from sectors, percents, bytes, kilobytes, etc. Note that one kilobyte is equal to 1,000 bytes, as this is consistent with the SI prefixes and is used by hard disk manufacturers. If you prefer to see the sizes in units with binary prefixes, you should instead select one kilo binary byte (kibibyte), which is equal to 1,024 bytes. Whatever display unit you have chosen, you can always enter the quantities in the unit of your choice, for example 1000000B or 1000kB. compact display each size in the most suitable unit from B, kB, MB, GB and TB. B one byte kB one kilobyte (1,000 bytes) MB one megabyte (1,000,000 bytes) GB one gigabyte (1,000,000,000 bytes) TB one terabyte (1,000,000,000,000 bytes) KiB one kilo binary byte (1,024 bytes) MiB one mega binary byte (1,048,576 bytes) GiB one giga binary byte (1,073,741,824 bytes) TiB one tera binary byte (1,099,511,627,776 bytes) s one sector. It depends on the sector size of the disk. You can use it if you want to see or choose the exact size in sectors. % one percent from the size of the disk cyl one cylinder. It depends on the cylinder size. chs use CHS display units. BUGS
There are no known bugs. We are in early stages for development, so be careful. SEE ALSO
fdisk(8), mkfs(8), parted(8) The cfdisk program is fully documented in the info(1) format GNU cfdisk User Manual manual. fdisk 16 June, 2006 CFDISK(8)
All times are GMT -4. The time now is 11:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy