Sponsored Content
Top Forums Shell Programming and Scripting How to concat line first and then removing the ^M character Post 302242632 by vsantoshusa on Thursday 2nd of October 2008 12:58:37 PM
Old 10-02-2008
Hari

I know the answer for removing the ^M ie..

awk '{ sub("\r$", ""); print }' filenew > newfilename which works for me .

First we have to search ^M and then concat the line and then remove . I am not able to find concat ideas.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing character from list line (at the end)

Hi, I have file as shown below. abc, def, abc, xyz, I have to remove ',' from end of last line (xyz,). How can I do that with single command? Is it possible or I have to iterate through complete file to remove that? - Malay (2 Replies)
Discussion started by: malaymaru
2 Replies

2. Shell Programming and Scripting

removing new line character

I'm appending header and trailer record for a binary file using echo "$header" > filename cat oldfilename >> filename echo "$trailer" >> filename The echo is introducing newline character after header and trailer.Please let me know is there any possibility to get rid of newline character. (2 Replies)
Discussion started by: ammu
2 Replies

3. UNIX for Dummies Questions & Answers

removing a character and addending to end in each line in a file

HI i am having a file this (sys19:pnlfct:/pfact/temp>) cat temp_sand 1234567890 1234567890 1234567890 1234567890 I want to make this file as (sys19:pnlfct:/pfact/temp>) cat temp_sand 1456789023 1456789023 1456789023 1456789023 just take the 2nd and 3rd position and put it... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. Shell Programming and Scripting

Removing last character from each line of file

How can I remove the last character from each line of a file? This must be done without "funny" characters, as I want to transfer the code to/from Windows. Any ideas? (17 Replies)
Discussion started by: cjhancock
17 Replies

5. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

6. UNIX for Dummies Questions & Answers

Removing a character

I need to remove square brackets from output of script. Output is: and I need to remove the square brackets so I am lett with 121 Is sed the only means to do this and if so what are the options? ...ok so far I have managed to get rid of ] by using /usr/bin/sed 's/]//' but that... (5 Replies)
Discussion started by: rob171171
5 Replies

7. UNIX for Dummies Questions & Answers

Need help removing last character of every line if certain character

I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position. Input: aaa% %bbb ccc d%dd% Output should be: aaa %bbb ccc d%dd I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5 Replies

8. Shell Programming and Scripting

removing last character

Hi, I have a file that has data something like below: A B C D ..... ...... .....and so on I am trying to bring it in one line with comma delimited something like below : A,B,C,D I tried the something below in the code section: cat File.txt | tr '\n' ',' (1 Reply)
Discussion started by: rkumar28
1 Replies

9. Shell Programming and Scripting

Removing first and last character of line

Hi all, Please help me to remove first and last character of each line in a file. Thanks, Baski (5 Replies)
Discussion started by: baskivs
5 Replies

10. Shell Programming and Scripting

Removing last character of a specific line from a file

Hello guys, I would need to remove the last character ")" of a specific line. This can be from any line. Your help is appreciated. Below is the line. HOSTNAME=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)) Please help. (6 Replies)
Discussion started by: sang8g
6 Replies
GENLIB_FLATTEN_PHFIG.3(October 1, 1997) 								   GENLIB_FLATTEN_PHFIG.3(October 1, 1997)

NAME
GENLIB_FLATTEN_PHFIG - flatten an instance in the current layout figure SYNOPSYS
#include <genlib.h> void GENLIB_FLATTEN_PHFIG(insname,concat) char *insname; char concat; ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr PARAMETERS
insname Name of the instance to be flattened concat Indicate whether or not to concatenate instance name to instance' objects name DESCRIPTION
FLATTEN_PHFIG inserts the contents of an instance, but its connectors, in the current figure, and then destroys the instance. The concat parameter may take two values: YES to concatenate object name with instance names. NO to copy object names. In most case, the concat value must be YES, in order to warranty the unicity of names in the figure. It may otherwise fail, because the function would try to add in the current figure some object with an already existing name. EXAMPLE
#include <genlib.h> main() { /* Create a figure to work on */ GENLIB_DEF_PHFIG("mycell"); . . . /* Place an instance */ GENLIB_PLACE("model","instance", SYM_X, 0, 0); /* flatten an instance */ GENLIB_FLATTEN_PHFIG("instance", YES); /* Save all that on disk */ GENLIB_SAVE_PHFIG(); } SEE ALSO
genlib(1), GENLIB_LOINS(3). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. PROCEDURAL GENERATION LANGUAGE
ASIM/LIP6 GENLIB_FLATTEN_PHFIG.3(October 1, 1997)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy