newline character, space and tab after a string


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users newline character, space and tab after a string
# 1  
Old 07-10-2008
newline character, space and tab after a string

no problem

Last edited by angelina; 07-12-2008 at 11:36 AM.. Reason: added code tags
# 2  
Old 07-11-2008
Since it's your input file that's messed up, why not just edit it and correct it? I think cat -evt will show you a little more info on what is actually in the file.
# 3  
Old 07-11-2008
I did fix it in vi .....thats not a problem ......but to automate it how do i work on it........plz suggest me .......

Last edited by angelina; 07-11-2008 at 11:47 PM.. Reason: use code tags
# 4  
Old 07-11-2008
Try this:

Code:
perl -i.bak -0777 -ple's/(".*?)[\r\n]*(.*?")/$1$2/g' file


Last edited by radoulov; 07-11-2008 at 09:36 AM.. Reason: added the g swith
# 5  
Old 07-11-2008
Hi rad,

I just copied ur command and pasted on the prompt.infact i used this

Last edited by angelina; 07-11-2008 at 11:47 PM..
# 6  
Old 07-11-2008
It's correct Smilie The above command modified your original file (backed up in input.csv.bak). You don't need to redirect ...
# 7  
Old 07-11-2008
wish u all the best. muaaaaaaaaaahhhhhhhhhh

Last edited by angelina; 07-11-2008 at 11:48 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies

2. Shell Programming and Scripting

How to remove newline, tab, spaces in curly braces.. :( Pls Help?

Hi Everyone, in the below "xyz (Exception e)" part... after the curly braces, there is a new line and immediately few tabs are present before closing curly brace. xyz (Exception e) { } note: there can be one or more newlines between the curly braces. My desired output should be ... (6 Replies)
Discussion started by: NY_777
6 Replies

3. Shell Programming and Scripting

Substitute newline with tab at designated field separator

Hello, I need to replace newline with tab at certain lines of the file (every four lines is a record). infile.fq: @GAIIX-300 ATAGTCAAAT + _SZS^\\\cd @GAIIX-300 CATACGACAT + hhghfdffhh @GAIIX-300 GACGACGTAT + gggfcfoutfile: @GAIIX-300 ATAGTCAAAT + _SZS^\\\cd @GAIIX-300 ... (6 Replies)
Discussion started by: yifangt
6 Replies

4. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

5. Shell Programming and Scripting

Replace newline character between a double quotes to a space

Hi Guys, I have a file with content as below aj.txt "Iam allfine" abcdef abcd "all is not well" What I'm trying to say is my data has some new line characters in between quoted text. I must get ride of the newline character that comes in between the quoted text. output must be:... (8 Replies)
Discussion started by: ajahuja
8 Replies

6. Shell Programming and Scripting

Inserting newline in front of multi-character string

I'm working with a large file with multiple records, each record begins with ISA. The issue is, sometimes ISA is at the start of the line, sometimes it's in the middle of the line. So before I can csplit my main file into multiple records, I have to get each record header onto its own line. ... (7 Replies)
Discussion started by: verge
7 Replies

7. Shell Programming and Scripting

sed newline to tab ,problem

Input: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly sed 's/\n/\t/g' infile It's not working. Output should be: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly (5 Replies)
Discussion started by: cola
5 Replies

8. Shell Programming and Scripting

Delete parts of a string of character in one given column of a tab delimited file

I would like to remove characters from column 7 so that from an input file looking like this: >HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD I get something like that in an output file: ... (13 Replies)
Discussion started by: matlavmac
13 Replies

9. Shell Programming and Scripting

Concatenate the string with the newline character

Hi , i want to Concatenate a string and use the following code str="i" str="$str am \n" str="$str a \n" str="$str boy \n" echo $str I want to ouput this i am a boy However it outputs i am \n a \n boy \n (3 Replies)
Discussion started by: youareapkman
3 Replies

10. Shell Programming and Scripting

why convert 8 space to 1 tab character on unix?

Hi everybody, I'm using Hp unix tru64. I have generate one file from shell script. bus that file content pre "8 space char" convert one tab character. why? result file hex format: hex 20 20 20 20 20 to 09 (6 Replies)
Discussion started by: Tlg13team
6 Replies
Login or Register to Ask a Question